refactor to adapters
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import type { IValueObject } from '@gridpilot/shared/domain';
|
||||
|
||||
export interface UserIdProps {
|
||||
@@ -14,6 +15,10 @@ export class UserId implements IValueObject<UserIdProps> {
|
||||
this.props = { value };
|
||||
}
|
||||
|
||||
public static create(): UserId {
|
||||
return new UserId(uuidv4());
|
||||
}
|
||||
|
||||
public static fromString(value: string): UserId {
|
||||
return new UserId(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user