mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
* refactor: flatten infra folders * fix: database migrations * fix: test related import * fix: github actions workflow * chore: rename schemas to typesense-schemas
27 lines
680 B
TypeScript
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,
|
|
};
|
|
}
|