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

export class ShiftVC {
    @IsNumber()
    @Expose()
    @IsOptional()
    id?: number;

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

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

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

    @IsOptional()
    @IsBoolean()
    @Expose()
    isRest?: boolean;

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

    @IsOptional()
    @IsBoolean()
    @Expose()
    saveAsTemplate?: boolean;
}
