/** Public API of the promotions module. */
import type pg from 'pg';
import { PromotionServiceImpl } from './application/promotion-service.js';
import type { PromotionService } from './domain/ports.js';
import { PgPromotionRepository } from './infrastructure/pg-promotion-repository.js';

export { registerPromotionsRoutes, type PromotionsRoutesDeps } from './api/promotions.routes.js';
export type { PromotionService as PromotionServicePort } from './domain/ports.js';
export type { PromotionRepository } from './domain/ports.js';
export type {
  NewPromotion,
  Promotion,
  PromotionDiscount,
  PromotionType,
} from './domain/promotion.js';

export function createPromotionService(pool: pg.Pool): PromotionService {
  return new PromotionServiceImpl(new PgPromotionRepository(pool));
}
