24 lines
731 B
TypeScript
24 lines
731 B
TypeScript
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;
|
|
}
|