From d071e6be742e158f873a9906d5d050ca75cf2273 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Mon, 7 Sep 2026 21:02:27 -0300 Subject: [PATCH] feat(f4): add JEFE deadline administration DTOs --- .../dto/update-deadline-policy.dto.ts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 api-v3/src/inspection-reports/dto/update-deadline-policy.dto.ts diff --git a/api-v3/src/inspection-reports/dto/update-deadline-policy.dto.ts b/api-v3/src/inspection-reports/dto/update-deadline-policy.dto.ts new file mode 100644 index 0000000..4407473 --- /dev/null +++ b/api-v3/src/inspection-reports/dto/update-deadline-policy.dto.ts @@ -0,0 +1,48 @@ +import { Transform, Type } from 'class-transformer'; +import { + IsBoolean, + IsDateString, + IsEnum, + IsInt, + IsString, + Max, + MaxLength, + Min, + MinLength, +} from 'class-validator'; +import { InspectionDeadlineDayType } from '../../database/entities'; + +export class UpdateDeadlinePolicyDto { + @Type(() => Number) + @IsInt() + @Min(1) + @Max(365) + urgentDays!: number; + + @IsEnum(InspectionDeadlineDayType) + urgentDayType!: InspectionDeadlineDayType; + + @Type(() => Number) + @IsInt() + @Min(1) + @Max(365) + nonUrgentDays!: number; + + @IsEnum(InspectionDeadlineDayType) + nonUrgentDayType!: InspectionDeadlineDayType; +} + +export class UpsertBusinessCalendarDayDto { + @IsDateString() + date!: string; + + @Transform(({ value }) => value === true || value === 'true') + @IsBoolean() + isBusinessDay!: boolean; + + @Transform(({ value }) => typeof value === 'string' ? value.trim() : value) + @IsString() + @MinLength(1) + @MaxLength(200) + label!: string; +}