diff --git a/src/application/command/create-resource.handler.ts b/src/application/command/create-resource.handler.ts index bddee0b..279bded 100644 --- a/src/application/command/create-resource.handler.ts +++ b/src/application/command/create-resource.handler.ts @@ -34,6 +34,7 @@ export class CreateResourceHandler parentType: command.parentType ? (command.parentType as ResourceParentType) : undefined, + creatorId: new UUID(command.creatorId), }, command.id ? new UUID(command.id) : undefined ); diff --git a/src/application/command/dto/create-resource.command.ts b/src/application/command/dto/create-resource.command.ts index d5e923e..bafc7d5 100644 --- a/src/application/command/dto/create-resource.command.ts +++ b/src/application/command/dto/create-resource.command.ts @@ -12,6 +12,7 @@ export class CreateResourceCommand extends Command { readonly type!: string; readonly parentId?: string; readonly parentType?: string; + readonly creatorId!: string; readonly id?: string; readonly clientCreatedAt?: Date; } diff --git a/src/domain/resource/resource.ts b/src/domain/resource/resource.ts index 5e6906b..60f470c 100644 --- a/src/domain/resource/resource.ts +++ b/src/domain/resource/resource.ts @@ -58,6 +58,10 @@ export class Resource extends AggregateRoot { return this.props.parentType; } + get creatorId(): UUID { + return this.props.creatorId; + } + get clientCreatedAt(): DateVO { return this.props.clientCreatedAt; } diff --git a/src/domain/resource/resource.types.ts b/src/domain/resource/resource.types.ts index 710a18a..93d2053 100644 --- a/src/domain/resource/resource.types.ts +++ b/src/domain/resource/resource.types.ts @@ -28,6 +28,7 @@ export interface CreateResourceProps { parentId?: UUID; parentType?: ResourceParentType; clientCreatedAt?: DateVO; + creatorId: UUID; } export interface ResourceProps extends CreateResourceProps {