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

/**
 * DTO for fetching country details based on an array of country IDs.
 *
 * This DTO expects a non-empty array of country IDs (strings).
 * It is typically used when you want to retrieve full country details
 * for multiple countries by their IDs.
 */
export class CountriesDetailsByIdsDto {
  /**
   * Array of country IDs to fetch details for.
   *
   * Validation:
   * - Must be provided (`@IsNotEmpty`).
   * - Must be an array (`@IsArray`).
   *
   * Example: ["IN", "US", "AU"]
   */
  @ApiProperty({
    description: 'Array of country IDs to fetch details for',
    example: ['IN', 'US', 'AU'],
    type: [String],
  })
  @IsNotEmpty({ message: 'Countries array cannot be empty' })
  @IsArray({ message: 'Countries must be an array of strings' })
  countries: string[];
}
