import { Transform } from 'class-transformer'; import { ArrayMaxSize, ArrayMinSize, ArrayUnique, IsArray, IsISO8601, IsOptional, IsString, IsUUID, MaxLength, MinLength, } from 'class-validator'; export class UpdateInspectionActDto { @IsOptional() @IsISO8601({ strict: true }) occurredAt?: string; @IsOptional() @Transform(({ value }) => (typeof value === 'string' ? value.trim() : value)) @IsString() @MinLength(1) @MaxLength(200) title?: string; @IsOptional() @Transform(({ value }) => (typeof value === 'string' ? value.trim() : value)) @IsString() @MinLength(1) @MaxLength(20000) summary?: string; @IsOptional() @Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null, ) @IsString() @MaxLength(8000) observations?: string | null; @IsOptional() @IsArray() @ArrayMinSize(1) @ArrayMaxSize(200) @ArrayUnique() @IsUUID('4', { each: true }) assetIds?: string[]; }