Files
backend/libs/common/src/firebase/devices-status/dtos/add.devices-status.dto.ts
2024-10-27 09:56:23 +03:00

42 lines
595 B
TypeScript

import {
IsString,
IsArray,
ValidateNested,
IsNotEmpty,
IsOptional,
} from 'class-validator';
import { Type } from 'class-transformer';
class StatusDto {
@IsString()
code: string;
@IsNotEmpty()
value: any;
}
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;
}