mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 12:41:04 +00:00
75 lines
1.6 KiB
TypeScript
75 lines
1.6 KiB
TypeScript
import { ApiPropertyOptional } from "@nestjs/swagger";
|
||
import {
|
||
ArrayMaxSize,
|
||
IsArray,
|
||
IsBoolean,
|
||
IsEnum,
|
||
IsInt,
|
||
IsOptional,
|
||
IsString,
|
||
Max,
|
||
MaxLength,
|
||
Min,
|
||
} from "class-validator";
|
||
|
||
import { ELeaveYearBasis } from "../entities/leave-settings.entity";
|
||
|
||
export class UpdateLeaveSettingsDto {
|
||
@ApiPropertyOptional({ enum: ELeaveYearBasis })
|
||
@IsOptional()
|
||
@IsEnum(ELeaveYearBasis)
|
||
leaveYearBasis?: ELeaveYearBasis;
|
||
|
||
@ApiPropertyOptional({ minimum: 1, maximum: 12, default: 7 })
|
||
@IsOptional()
|
||
@IsInt()
|
||
@Min(1)
|
||
@Max(12)
|
||
fiscalYearStartMonth?: number;
|
||
|
||
@ApiPropertyOptional({ minimum: 1, maximum: 31, default: 8 })
|
||
@IsOptional()
|
||
@IsInt()
|
||
@Min(1)
|
||
@Max(31)
|
||
fiscalYearStartDay?: number;
|
||
|
||
@ApiPropertyOptional({
|
||
type: [Number],
|
||
example: [0, 6],
|
||
description:
|
||
"Non-working days of the week, 0 = Sunday … 6 = Saturday. Defaults to [0], " +
|
||
"the six-day week the statutory leave figures assume. Set [0,6] for a " +
|
||
"Monday–Friday employer.",
|
||
})
|
||
@IsOptional()
|
||
@IsArray()
|
||
@ArrayMaxSize(6)
|
||
@IsInt({ each: true })
|
||
@Min(0, { each: true })
|
||
@Max(6, { each: true })
|
||
weekendDays?: number[];
|
||
|
||
@ApiPropertyOptional({ minimum: 0, maximum: 24, default: 6 })
|
||
@IsOptional()
|
||
@IsInt()
|
||
@Min(0)
|
||
@Max(24)
|
||
carryOverDeadlineMonths?: number;
|
||
|
||
@ApiPropertyOptional({
|
||
default: false,
|
||
description:
|
||
"Whether a request may be approved that takes a balance below zero.",
|
||
})
|
||
@IsOptional()
|
||
@IsBoolean()
|
||
allowNegativeBalance?: boolean;
|
||
|
||
@ApiPropertyOptional({ maxLength: 64 })
|
||
@IsOptional()
|
||
@IsString()
|
||
@MaxLength(64)
|
||
statuteReference?: string;
|
||
}
|