import { ApiPropertyOptional } from '@nestjs/swagger';
import { Transform, Type } from 'class-transformer';
import { IsBoolean, IsNumber, IsOptional, Max, Min } from 'class-validator';
import { toBoolean } from '../../../common/utils/query-transform.util';
import { UserQueryDto } from './user-query.dto';

export class TalentDiscoverQueryDto extends UserQueryDto {
  @ApiPropertyOptional({ default: true })
  @IsOptional()
  @Transform(toBoolean)
  @IsBoolean()
  hasAvatarOnly?: boolean;

  @ApiPropertyOptional({ default: true })
  @IsOptional()
  @Transform(toBoolean)
  @IsBoolean()
  includeRoleBuckets?: boolean;

  @ApiPropertyOptional({ minimum: 1, maximum: 24, default: 8 })
  @IsOptional()
  @Type(() => Number)
  @IsNumber()
  @Min(1)
  @Max(24)
  limit?: number;
}
