From 7974429fdd02a34516e86e4ebeec8497a759a32b Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 10 Oct 2023 16:52:36 +0200 Subject: [PATCH] fix user id --- src/modules/user/core/domain/user.entity.ts | 1 - src/modules/user/user.mapper.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/user/core/domain/user.entity.ts b/src/modules/user/core/domain/user.entity.ts index 3eb77b2..8978789 100644 --- a/src/modules/user/core/domain/user.entity.ts +++ b/src/modules/user/core/domain/user.entity.ts @@ -12,7 +12,6 @@ export class UserEntity extends AggregateRoot { const id = create.id ?? v4(); const props: UserProps = { ...create }; const user = new UserEntity({ id, props }); - user.addEvent( new UserCreatedDomainEvent({ aggregateId: id, diff --git a/src/modules/user/user.mapper.ts b/src/modules/user/user.mapper.ts index ae6f848..a3ace04 100644 --- a/src/modules/user/user.mapper.ts +++ b/src/modules/user/user.mapper.ts @@ -21,7 +21,7 @@ export class UserMapper toPersistence = (entity: UserEntity): UserWriteModel => { const copy = entity.getProps(); const record: UserWriteModel = { - uuid: copy.id, + uuid: entity.id, firstName: copy.firstName, lastName: copy.lastName, email: copy.email,