/**
 * Rate Search Filters Types
 *
 * TypeScript types for advanced rate search filters
 * Matches backend DTOs
 */

export interface RateSearchFilters {
  // Company filters
  companies?: string[];

  // Volume/Weight filters
  minVolumeCBM?: number;
  maxVolumeCBM?: number;
  minWeightKG?: number;
  maxWeightKG?: number;
  palletCount?: number;

  // Price filters
  minPrice?: number;
  maxPrice?: number;
  currency?: 'USD' | 'EUR';

  // Transit filters
  minTransitDays?: number;
  maxTransitDays?: number;

  // Container type filters
  containerTypes?: string[];

  // Surcharge filters
  onlyAllInPrices?: boolean;

  // Date filters
  departureDate?: string; // ISO date string
}

export interface CsvRateSearchRequest {
  origin: string;
  destination: string;
  volumeCBM: number;
  weightKG: number;
  palletCount?: number;
  containerType?: string;
  filters?: RateSearchFilters;
}

export interface CsvRateResult {
  companyName: string;
  origin: string;
  destination: string;
  containerType: string;
  priceUSD: number;
  priceEUR: number;
  primaryCurrency: string;
  hasSurcharges: boolean;
  surchargeDetails: string | null;
  transitDays: number;
  validUntil: string;
  source: 'CSV' | 'API';
  matchScore: number;
}

export interface CsvRateSearchResponse {
  results: CsvRateResult[];
  totalResults: number;
  searchedFiles: string[];
  searchedAt: string;
  appliedFilters: RateSearchFilters;
}

export interface AvailableCompanies {
  companies: string[];
  total: number;
}

export interface FilterOptions {
  companies: string[];
  containerTypes: string[];
  currencies: string[];
}
