import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsNumber } from 'class-validator';

/**
 * DTO for searching associates based on association type and optional filters.
 *
 * This DTO can be used to query associates in the system with optional
 * filtering by visa service country.
 */
export class SearchAssociatesDto {
  /**
   * Type of association to filter the search.
   *
   * Required field:
   * - Must be a number corresponding to a valid association type.
   * - Example: 1 (could represent INSTITUTE, AGENT, etc.)
   */
  @ApiProperty()
  @IsNotEmpty()
  @IsNumber()
  association_type: number;

  /**
   * Optional filter for visa service country ID.
   *
   * Optional field:
   * - Must be a number if provided.
   * - Helps narrow down associates belonging to a specific visa service country.
   */
  @ApiPropertyOptional()
  @IsOptional()
  @IsNumber()
  visa_service_country_id: number;
}
