/**
 * RateQuote Repository Port
 *
 * Defines the interface for RateQuote persistence operations.
 * This is a secondary port (output port) in hexagonal architecture.
 */

import { RateQuote } from '../../entities/rate-quote.entity';

export const RATE_QUOTE_REPOSITORY = 'RateQuoteRepository';

export interface RateQuoteRepository {
  /**
   * Save a rate quote entity
   */
  save(rateQuote: RateQuote): Promise<RateQuote>;

  /**
   * Save multiple rate quote entities
   */
  saveMany(rateQuotes: RateQuote[]): Promise<RateQuote[]>;

  /**
   * Find rate quote by ID
   */
  findById(id: string): Promise<RateQuote | null>;

  /**
   * Find rate quotes by search criteria
   */
  findBySearchCriteria(criteria: {
    origin: string;
    destination: string;
    containerType: string;
    departureDate: Date;
  }): Promise<RateQuote[]>;

  /**
   * Find all rate quotes for a specific carrier
   */
  findByCarrier(carrierId: string): Promise<RateQuote[]>;

  /**
   * Delete expired rate quotes
   * Returns the number of deleted records
   */
  deleteExpired(): Promise<number>;

  /**
   * Delete rate quote by ID
   */
  deleteById(id: string): Promise<void>;
}
