export interface PriceSnapshot {
  amount: bigint
  currency: string
  priceMode: 'inclusive' | 'exclusive'
}

export interface CartLine {
  lineId: string
  variantId: string
  qty: number
  price: PriceSnapshot
  vendorId: string | null
}

export interface Cart {
  id: string
  currency: string
  lines: CartLine[]
  subtotal: bigint
}

export type CartAction =
  | {
      type: 'addLine'
      variantId: string
      qty: number
      price: PriceSnapshot
      vendorId?: string | null
    }
  | { type: 'setQty'; lineId: string; qty: number }
  | { type: 'removeLine'; lineId: string }
  | { type: 'clear' }
