import { OptionalNumbersStringToNumbersArray } from '@humand-packages/common';
import { Expose } from 'class-transformer';
import { IsArray, IsNumber, IsOptional, IsString, MaxLength } from 'class-validator';

export class WorkScheduleUserAssignmentFiltersVC {
    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    @OptionalNumbersStringToNumbersArray()
    userIds!: number[];

    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    @OptionalNumbersStringToNumbersArray()
    itemIds!: number[];

    @IsOptional()
    @IsString()
    @MaxLength(255)
    @Expose()
    search?: string;

    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    @OptionalNumbersStringToNumbersArray()
    departmentIds!: number[];

    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    @OptionalNumbersStringToNumbersArray()
    excludeDepartmentIds!: number[];

    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    @OptionalNumbersStringToNumbersArray()
    regionIds!: number[];

    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    @Expose()
    @OptionalNumbersStringToNumbersArray()
    siteIds!: number[];
}
