Files
immich/server/libs/domain/src/device-info/response-dto/device-info-response.dto.ts
Jason Rasmussen 34d300d1da refactor(server): flatten infra folders (#2120)
* refactor: flatten infra folders

* fix: database migrations

* fix: test related import

* fix: github actions workflow

* chore: rename schemas to typesense-schemas
2023-03-30 14:38:55 -05:00

27 lines
680 B
TypeScript

import { DeviceInfoEntity, DeviceType } from '@app/infra/entities';
import { ApiProperty } from '@nestjs/swagger';
export class DeviceInfoResponseDto {
@ApiProperty({ type: 'integer' })
id!: number;
userId!: string;
deviceId!: string;
@ApiProperty({ enumName: 'DeviceTypeEnum', enum: DeviceType })
deviceType!: DeviceType;
createdAt!: string;
isAutoBackup!: boolean;
}
export function mapDeviceInfoResponse(entity: DeviceInfoEntity): DeviceInfoResponseDto {
return {
id: entity.id,
userId: entity.userId,
deviceId: entity.deviceId,
deviceType: entity.deviceType,
createdAt: entity.createdAt,
isAutoBackup: entity.isAutoBackup,
};
}