/**
 * GetPortsPort (API Port - Input)
 *
 * Defines the interface for port autocomplete and retrieval
 */

import { Port } from '../../entities/port.entity';

export interface PortSearchInput {
  query: string; // Search query (port name, city, or code)
  limit?: number; // Max results (default: 10)
  countryFilter?: string; // ISO country code filter
}

export interface PortSearchOutput {
  ports: Port[];
  totalMatches: number;
}

export interface GetPortInput {
  portCode: string; // UN/LOCODE
}

export interface GetPortsPort {
  /**
   * Search ports by query (autocomplete)
   * @param input - Port search parameters
   * @returns Matching ports
   */
  search(input: PortSearchInput): Promise<PortSearchOutput>;

  /**
   * Get port by code
   * @param input - Port code
   * @returns Port entity
   */
  getByCode(input: GetPortInput): Promise<Port>;

  /**
   * Get multiple ports by codes
   * @param portCodes - Array of port codes
   * @returns Array of ports
   */
  getByCodes(portCodes: string[]): Promise<Port[]>;
}
