30 lines
608 B
TypeScript
30 lines
608 B
TypeScript
import { IsBoolean, IsEnum, IsInt, IsOptional, IsString, Matches, Min } from "class-validator";
|
|
import { HH_MM_REGEX } from "src/common/utils/constants.utils";
|
|
import { Weekday } from "@prisma/client";
|
|
|
|
export class SchedulePresetShiftsDto {
|
|
@IsEnum(Weekday)
|
|
week_day!: Weekday;
|
|
|
|
@IsInt()
|
|
preset_id!: number;
|
|
|
|
@IsInt()
|
|
@Min(1)
|
|
sort_order!: number;
|
|
|
|
@IsString()
|
|
type!: string;
|
|
|
|
@IsString()
|
|
@Matches(HH_MM_REGEX)
|
|
start_time!: string;
|
|
|
|
@IsString()
|
|
@Matches(HH_MM_REGEX)
|
|
end_time!: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
is_remote?: boolean;
|
|
} |