feat(f4): add JEFE deadline administration DTOs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user