Files
dh-inspeccion-v2/api-v3/src/asset-master/dto/review-field-discovery.dto.ts
T

30 lines
760 B
TypeScript

import { Transform } from 'class-transformer';
import { IsOptional, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
export class ReviewFieldDiscoveryDto {
@IsOptional()
@Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null)
@IsString()
@MaxLength(4000)
notes?: string | null;
}
export class RejectFieldDiscoveryDto {
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
@IsString()
@MinLength(5)
@MaxLength(4000)
reason!: string;
}
export class MatchFieldDiscoveryDto {
@IsUUID('4')
matchedAssetId!: string;
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
@IsString()
@MinLength(5)
@MaxLength(4000)
reason!: string;
}