2023-03-30 15:38:55 -04:00
|
|
|
import { UserEntity } from '@app/infra/entities';
|
2022-06-06 18:16:03 +02:00
|
|
|
|
2022-07-08 21:26:50 -05:00
|
|
|
export class UserResponseDto {
|
|
|
|
|
id!: string;
|
|
|
|
|
email!: string;
|
|
|
|
|
firstName!: string;
|
|
|
|
|
lastName!: string;
|
2023-05-21 23:18:10 -04:00
|
|
|
storageLabel!: string | null;
|
2022-07-08 21:26:50 -05:00
|
|
|
profileImagePath!: string;
|
|
|
|
|
shouldChangePassword!: boolean;
|
|
|
|
|
isAdmin!: boolean;
|
2023-05-30 15:15:56 +02:00
|
|
|
createdAt!: Date;
|
|
|
|
|
deletedAt!: Date | null;
|
|
|
|
|
updatedAt!: Date;
|
2022-12-26 10:35:52 -05:00
|
|
|
oauthId!: string;
|
2022-06-06 18:16:03 +02:00
|
|
|
}
|
|
|
|
|
|
2022-06-25 19:53:06 +02:00
|
|
|
export function mapUser(entity: UserEntity): UserResponseDto {
|
2022-06-06 18:16:03 +02:00
|
|
|
return {
|
|
|
|
|
id: entity.id,
|
|
|
|
|
email: entity.email,
|
|
|
|
|
firstName: entity.firstName,
|
|
|
|
|
lastName: entity.lastName,
|
2023-05-21 23:18:10 -04:00
|
|
|
storageLabel: entity.storageLabel,
|
2022-07-08 21:26:50 -05:00
|
|
|
profileImagePath: entity.profileImagePath,
|
|
|
|
|
shouldChangePassword: entity.shouldChangePassword,
|
|
|
|
|
isAdmin: entity.isAdmin,
|
2023-05-30 15:15:56 +02:00
|
|
|
createdAt: entity.createdAt,
|
2022-11-26 17:16:02 +01:00
|
|
|
deletedAt: entity.deletedAt,
|
2023-03-03 23:38:30 +01:00
|
|
|
updatedAt: entity.updatedAt,
|
2022-12-26 10:35:52 -05:00
|
|
|
oauthId: entity.oauthId,
|
2022-06-06 18:16:03 +02:00
|
|
|
};
|
|
|
|
|
}
|