import { Expose, Type } from 'class-transformer';
import { IsArray, IsBoolean, IsDefined, IsEnum, IsOptional, IsString, IsUUID, MaxLength, ValidateNested } from 'class-validator';
import {
    TimeTrackingCategorizedHourApprovalStepReviewableStates,
    TimeTrackingCategorizedHourApprovalStepState,
} from '../../../infrastructure/constants/timeTracking/categorizedHourApprovalStepStates';
import { CategorizedHoursFiltersVC } from './categorizedHoursFiltersVC';

export class BulkReviewCategorizedHoursVC {
    @IsDefined()
    @IsEnum(TimeTrackingCategorizedHourApprovalStepReviewableStates)
    @Expose()
    state!: TimeTrackingCategorizedHourApprovalStepState.APPROVED | TimeTrackingCategorizedHourApprovalStepState.REJECTED;

    @IsOptional()
    @IsString()
    @MaxLength(1000)
    @Expose()
    comment?: string;

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

    @IsOptional()
    @IsArray()
    @IsUUID(undefined, { each: true })
    @Expose()
    categorizedHourIds?: string[];

    @IsOptional()
    @IsArray()
    @IsUUID(undefined, { each: true })
    @Expose()
    excludeCategorizedHourIds?: string[];

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