/** Public API of the shipping module. */
import type pg from 'pg';
import { ShippingService } from './application/shipping-service.js';
import { PgShippingRepository } from './infrastructure/pg-shipping-repository.js';

export { registerShippingRoutes, type ShippingRoutesDeps } from './api/shipping.routes.js';
export { ShippingService } from './application/shipping-service.js';
export type { ShippingService as ShippingServicePort, ShippingRepository } from './domain/ports.js';
export type {
  ShippingAddress,
  ShippingMethod,
  ShippingQuote,
  ShippingZone,
} from './domain/shipping.js';

export function createShippingService(pool: pg.Pool): ShippingService {
  return new ShippingService(new PgShippingRepository(pool));
}
