feature: users with treatment edit permission should now have working hours defined. the appointment grid is now being drawn based on the doctor's working hours.
This commit is contained in:
44
backend/src/modules/staff/dto/upsert-working-hours.dto.ts
Normal file
44
backend/src/modules/staff/dto/upsert-working-hours.dto.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { Type } from 'class-transformer';
|
||||
import {
|
||||
ArrayMaxSize,
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsInt,
|
||||
IsOptional,
|
||||
Max,
|
||||
Min,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
|
||||
export class WorkingHoursBlockDto {
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(6)
|
||||
dayOfWeek: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
@Max(1439)
|
||||
startMinute: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Max(1440)
|
||||
endMinute: number;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Min(0)
|
||||
sortOrder?: number;
|
||||
}
|
||||
|
||||
export class UpsertWorkingHoursDto {
|
||||
@IsBoolean()
|
||||
autoRepeatWeekly: boolean;
|
||||
|
||||
@IsArray()
|
||||
@ArrayMaxSize(42)
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => WorkingHoursBlockDto)
|
||||
blocks: WorkingHoursBlockDto[];
|
||||
}
|
||||
Reference in New Issue
Block a user