/** Public API of the pricing module. */
import type pg from 'pg';
import { PricingService } from './application/pricing-service.js';
import { PgPricingRepository } from './infrastructure/pg-pricing-repository.js';

export { registerPricingRoutes, type PricingRoutesDeps } from './api/pricing.routes.js';
export { PricingService } from './application/pricing-service.js';
export type { PricingRepository, PricingService as PricingServicePort } from './domain/ports.js';
export type {
  PriceCalculation,
  PriceCalculationCommand,
  SetVariantPriceCommand,
  VariantPrice,
  VatRate,
} from './domain/price.js';

export function createPricingService(pool: pg.Pool): PricingService {
  return new PricingService(new PgPricingRepository(pool));
}
