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

/**
 * DTO for searching commission received information for a specific visa case.
 *
 * This DTO is used in endpoints where the user needs to fetch commission-related
 * details associated with a particular visa case ID.
 */
export class SearchCaseCommissionReceivedInfoDto {
  /**
   * The unique identifier of the visa case.
   *
   * Validation rules:
   * - Required field
   * - Must be an integer
   * - Transformed to a number automatically by class-transformer
   *
   * Example payload:
   * ```json
   * {
   *   "visa_case_id": 1
   * }
   * ```
   */
  @ApiProperty({
    required: true,
    example: 1,
    description: 'Visa Case ID to fetch commission received information for',
  })
  @IsNotEmpty({ message: 'Visa case ID is required' })
  @IsInt({ message: 'Visa case ID must be an integer' })
  @Type(() => Number)
  visa_case_id: number;
}
