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

import { Carrier } from '../../entities/carrier.entity';

export const CARRIER_REPOSITORY = 'CarrierRepository';

export interface CarrierRepository {
  /**
   * Save a carrier entity
   */
  save(carrier: Carrier): Promise<Carrier>;

  /**
   * Save multiple carrier entities
   */
  saveMany(carriers: Carrier[]): Promise<Carrier[]>;

  /**
   * Find carrier by ID
   */
  findById(id: string): Promise<Carrier | null>;

  /**
   * Find carrier by carrier code
   */
  findByCode(code: string): Promise<Carrier | null>;

  /**
   * Find carrier by SCAC (Standard Carrier Alpha Code)
   */
  findByScac(scac: string): Promise<Carrier | null>;

  /**
   * Find all active carriers
   */
  findAllActive(): Promise<Carrier[]>;

  /**
   * Find all carriers that support API integration
   */
  findWithApiSupport(): Promise<Carrier[]>;

  /**
   * Find all carriers (including inactive)
   */
  findAll(): Promise<Carrier[]>;

  /**
   * Update a carrier entity
   */
  update(carrier: Carrier): Promise<Carrier>;

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