diff --git a/api-v3/src/inspection-reports/dto/create-inspection-report-follow-up.dto.ts b/api-v3/src/inspection-reports/dto/create-inspection-report-follow-up.dto.ts new file mode 100644 index 0000000..e777ba7 --- /dev/null +++ b/api-v3/src/inspection-reports/dto/create-inspection-report-follow-up.dto.ts @@ -0,0 +1,23 @@ +import { Transform } from 'class-transformer'; +import { IsEnum, IsISO8601, IsOptional, IsString, MaxLength } from 'class-validator'; +import { InspectionReportFollowUpType } from '../../database/entities'; + +export class CreateInspectionReportFollowUpDto { + @IsEnum(InspectionReportFollowUpType) + type!: InspectionReportFollowUpType; + + @IsISO8601({ strict: true }) + occurredAt!: string; + + @IsOptional() + @Transform(({ value }) => typeof value === 'string' ? value.trim() || null : value) + @IsString() + @MaxLength(255) + externalReference?: string | null; + + @IsOptional() + @Transform(({ value }) => typeof value === 'string' ? value.trim() || null : value) + @IsString() + @MaxLength(20000) + description?: string | null; +}