refactor(server): device info (#1490)

* refactor(server): device info

* fix: export device service

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen
2023-02-01 15:55:06 -05:00
committed by GitHub
parent 32b9e0bad4
commit bb84464216
23 changed files with 249 additions and 189 deletions

View File

@@ -0,0 +1,26 @@
import { DeviceInfoEntity, DeviceType } from '@app/infra/db/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,
};
}

View File

@@ -0,0 +1 @@
export * from './device-info-response.dto';