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

/**
 * DTO used to search or filter intake records.
 *
 * Allows filtering intakes based on visa service country,
 * associated institute, and client originating country.
 *
 * All fields are optional to allow flexible querying.
 */
export class SearchIntakesDto {
  /**
   * Visa service country ID.
   *
   * Optional field:
   * - When provided, filters intakes linked to the specific visa service country.
   * - When omitted, returns intakes across all visa service countries.
   */
  @ApiProperty()
  @IsNumber()
  @IsOptional()
  visa_service_country_id: number;

  /**
   * Institute ID.
   *
   * Optional field:
   * - When provided, filters intakes linked to the specified institute.
   * - When omitted, returns intakes for all institutes.
   */
  @ApiProperty()
  @IsNumber()
  @IsOptional()
  institute_id: number;

  /**
   * Client originating country ID.
   *
   * Optional field:
   * - When provided, filters intakes for clients from the specified country.
   * - When omitted, returns intakes for clients from all countries.
   */
  @ApiProperty()
  @IsNumber()
  @IsOptional()
  client_from_country_id: number;
}
