import { DefaultValue, OptionalStringToStringsArray } from '@humand-packages/common';
import { Expose } from 'class-transformer';
import { IsArray, IsBoolean, IsNumberString, IsOptional, IsString } from 'class-validator';
import { BooleanTransform } from '../../../../middlewares/classTransformers/booleanTransform';

export class GetWorkScheduleRequestsVC {
    @IsNumberString()
    @Expose()
    id!: number;
}

export class GetWorkSchedulesRequestsVC {
    @IsOptional()
    @IsArray()
    @OptionalStringToStringsArray()
    @Expose()
    codes!: string[];

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

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

    @IsOptional()
    @IsBoolean()
    @BooleanTransform()
    @Expose()
    autoCreated?: boolean;

    @IsOptional()
    @IsBoolean()
    @BooleanTransform()
    @Expose()
    includeDeleted?: boolean;

    @IsOptional()
    @IsBoolean()
    @BooleanTransform()
    @DefaultValue(true)
    @Expose()
    includeCollaborators?: boolean;
}
