import { Expose, Type } from 'class-transformer';
import { ArrayMaxSize, IsArray, IsDefined, IsString, ValidateNested } from 'class-validator';
import { ShiftAssignDayEntryRequestVC } from './shiftAssignDayEntryRequestVC';

export class ShiftAssignEmployeeRequestVC {
    @IsDefined()
    @IsString()
    @Expose()
    employeeId!: string;

    @IsDefined()
    @IsArray()
    // TODO: This will be managed in service in nexts PR's
    @ArrayMaxSize(30, { message: 'Each employee can have a maximum of 30 assigned days.' })
    @ValidateNested({ each: true })
    @Type(() => ShiftAssignDayEntryRequestVC)
    @Expose()
    days!: ShiftAssignDayEntryRequestVC[];
}
