import type {
  PriceCalculation,
  PriceCalculationCommand,
  SetVariantPriceCommand,
  VariantPrice,
} from './price.js';

export interface PricingService {
  calculate(input: PriceCalculationCommand): Promise<PriceCalculation>;
  getVariantPrice(variantId: string): Promise<VariantPrice | undefined>;
  setVariantPrice(input: SetVariantPriceCommand): Promise<VariantPrice>;
  /**
   * Seeds a neutral default price row for a freshly created variant so that
   * GET /pricing/variants/:id never 404s right after creation (F-138). Idempotent:
   * no-op when a row already exists for the given variant_id.
   */
  seedVariantPrice(variantId: string): Promise<void>;
}

export interface PricingRepository {
  findByVariantId(variantId: string): Promise<VariantPrice | undefined>;
  setVariantPrice(input: SetVariantPriceCommand): Promise<VariantPrice>;
  seedVariantPrice(variantId: string): Promise<void>;
}
