refactor(server): domain/infra (#1298)

* refactor: user repository

* refactor: user module

* refactor: move database into infra

* refactor(cli): use user core

* chore: import path

* chore: tests
This commit is contained in:
Jason Rasmussen
2023-01-11 21:34:36 -05:00
committed by GitHub
parent 89a6ed2a5b
commit 131caa20eb
182 changed files with 701 additions and 676 deletions

View File

@@ -0,0 +1,29 @@
import { UserEntity } from '@app/infra';
export class UserResponseDto {
id!: string;
email!: string;
firstName!: string;
lastName!: string;
createdAt!: string;
profileImagePath!: string;
shouldChangePassword!: boolean;
isAdmin!: boolean;
deletedAt?: Date;
oauthId!: string;
}
export function mapUser(entity: UserEntity): UserResponseDto {
return {
id: entity.id,
email: entity.email,
firstName: entity.firstName,
lastName: entity.lastName,
createdAt: entity.createdAt,
profileImagePath: entity.profileImagePath,
shouldChangePassword: entity.shouldChangePassword,
isAdmin: entity.isAdmin,
deletedAt: entity.deletedAt,
oauthId: entity.oauthId,
};
}