immich/server/src/domain/user/response-dto/user-response.dto.ts

34 lines
851 B
TypeScript
Raw Normal View History

import { UserEntity } from '@app/infra/entities';
export class UserResponseDto {
id!: string;
email!: string;
firstName!: string;
lastName!: string;
storageLabel!: string | null;
profileImagePath!: string;
shouldChangePassword!: boolean;
isAdmin!: boolean;
createdAt!: Date;
deletedAt!: Date | null;
updatedAt!: Date;
oauthId!: string;
}
export function mapUser(entity: UserEntity): UserResponseDto {
return {
id: entity.id,
email: entity.email,
firstName: entity.firstName,
lastName: entity.lastName,
storageLabel: entity.storageLabel,
profileImagePath: entity.profileImagePath,
shouldChangePassword: entity.shouldChangePassword,
isAdmin: entity.isAdmin,
createdAt: entity.createdAt,
deletedAt: entity.deletedAt,
updatedAt: entity.updatedAt,
oauthId: entity.oauthId,
};
}