import { ISO_DATE } from '@humand-packages/common';
import { Expose, Type } from 'class-transformer';
import { IsArray, IsBoolean, IsNumber, IsOptional, ValidateNested } from 'class-validator';
import { IsValidDate } from '../../../../../middlewares/dateValidator';
import { ShiftAssignCellVC } from './shiftAssignCellVC';
import { ShiftManagementCalendarFiltersVC } from './shiftManagementCalendarFiltersVC';

export class ShiftBulkDeleteVC {
    @IsOptional()
    @IsBoolean()
    @Expose()
    allRows?: boolean;

    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    userIds?: number[];

    @IsOptional()
    @IsArray()
    @IsValidDate(ISO_DATE, { each: true })
    @Expose()
    dates?: string[];

    @IsOptional()
    @IsArray()
    @ValidateNested({ each: true })
    @Type(() => ShiftAssignCellVC)
    @Expose()
    cells?: ShiftAssignCellVC[];

    @IsOptional()
    @IsArray()
    @ValidateNested({ each: true })
    @Type(() => ShiftAssignCellVC)
    @Expose()
    excludeCells?: ShiftAssignCellVC[];

    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    assignedShiftIds?: number[];

    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    excludeAssignedShiftIds?: number[];

    @IsOptional()
    @ValidateNested()
    @Type(() => ShiftManagementCalendarFiltersVC)
    @Expose()
    filters?: ShiftManagementCalendarFiltersVC;
}
