import type { ShippingAddress, ShippingQuote } from './shipping.js';

export interface ShippingService {
  calculate(
    cartTotalCents: number,
    address: ShippingAddress,
    cartWeightKg?: number,
  ): Promise<ShippingQuote>;
}

export interface ShippingRepository {
  findMatchingZone(
    country: string,
    postalCode: string,
  ): Promise<
    | {
        zoneId: string;
        methods: Array<{
          id: string;
          name: string;
          baseCostCents: number;
          freeShippingThresholdCents: number | null;
          maxWeightKg: number | null;
          freeShippingMaxWeightKg: number | null;
          active: boolean;
        }>;
      }
    | undefined
  >;
}
