Files
backend/libs/common/src/firebase/devices-status/dtos/add.devices-status.dto.ts

43 lines
625 B
TypeScript

import {
IsString,
IsArray,
ValidateNested,
IsNotEmpty,
IsOptional,
} from 'class-validator';
import { Type } from 'class-transformer';
class StatusDto {
@IsString()
code: string;
@IsNotEmpty()
value: any;
t?: string | number | Date;
}
export class AddDeviceStatusDto {
@IsString()
@IsOptional()
deviceUuid?: string;
@IsString()
deviceTuyaUuid: string;
@IsString()
@IsOptional()
productUuid?: string;
@IsString()
@IsOptional()
productType?: string;
@IsArray()
@ValidateNested({ each: true })
@Type(() => StatusDto)
status: StatusDto[];
@IsOptional()
log?: any;
}