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; }