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

/**
 * DTO for searching product countries based on a product and associate type.
 *
 * This DTO is typically used when you want to filter or fetch a list of countries
 * associated with a specific product and type of association.
 */
export class SearchProductCountriesDto {
  /**
   * Product ID for which countries need to be searched.
   *
   * @example 'prod_101'
   */
  @ApiProperty({ description: 'Product ID to filter countries' })
  @IsNotEmpty({ message: 'Product ID is required' })
  @IsString({ message: 'Product ID must be a string' })
  product_id: string;

  /**
   * Type of associate for which the product-country mapping applies.
   * Examples: 'INSTITUTE', 'SUB_AGENT', etc.
   *
   * @example 'INSTITUTE'
   */
  @ApiProperty({ description: 'Type of associate' })
  @IsNotEmpty({ message: 'Associate type is required' })
  @IsString({ message: 'Associate type must be a string' })
  associate_type: string;
}
