import { Expose, Type } from 'class-transformer';
import { ArrayMaxSize, IsArray, IsEnum, ValidateNested } from 'class-validator';
import { ShiftRotationDayType } from '../../../business/enum/shiftManagement/shiftRotationDayType';
import { IsValidShiftRotationDay } from '../../validators/shiftManagement/isValidShiftRotationDay/isValidShiftRotationDay';
import { ShiftRotationDayShiftVC } from './shiftRotationDayShiftVC';

export class ShiftRotationDayVC {
    @IsEnum(ShiftRotationDayType)
    @IsValidShiftRotationDay()
    @Expose()
    type!: ShiftRotationDayType;

    @IsArray()
    @ArrayMaxSize(3)
    @ValidateNested({ each: true })
    @Type(() => ShiftRotationDayShiftVC)
    @Expose()
    shifts!: ShiftRotationDayShiftVC[];
}
