import { Expose } from 'class-transformer';
import { ArrayMinSize, IsArray, IsHexColor, IsOptional, IsString, IsUUID, MaxLength } from 'class-validator';
import { IsValidTimeSlotTuples } from '../../validators/isValidTimeSlotTuples/isValidTimeSlotTuples';

export class ShiftRotationDayShiftVC {
    @IsOptional()
    @IsUUID()
    @Expose()
    shiftCode?: string;

    @IsString()
    @MaxLength(250)
    @Expose()
    name!: string;

    @IsOptional()
    @IsString()
    @IsHexColor()
    @Expose()
    color?: string;

    @IsOptional()
    @IsString()
    @MaxLength(250)
    @Expose()
    description?: string;

    @IsArray()
    @ArrayMinSize(1)
    @IsValidTimeSlotTuples({ message: 'Each timeSlot must be a [start, end] in HH:mm format' })
    @Expose()
    timeSlots!: [string, string][];
}
