Skip to main content

Pricing

pricing is the Core bounded context of the Storefront area of the warehouse-systems fleet (IQVO/pricing). It answers what a shopper pays: the list price and sale windows of each catalogue item, the delivery charge per service tier, a synthetic tax table, and the binding, immutable, expiring price quote a checkout session is confirmed against. Money is integer minor units in one configured currency.

:::info What runs on develop One image, three binaries. cmd/api serves the REST API on :8080 and runs, in the same process, the transactional outbox relay, the offer-availability consumer and the clock-driven policy loop. cmd/a2a is an optional read-only A2A agent on :8093 and cmd/mcp an optional read-only MCP server on :8090 (chart value mcp.enabled, default off; warehouse-infra has not enabled it yet). The two read-only binaries run on real Postgres only, and cmd/api also on real Kafka only: there is no in-memory mode. warehouse-infra deploys the chart (helm-values/pricing.yaml) with the A2A agent enabled and the currency set to USD. :::

What the context owns​

ConceptWhere it livesRule in one line
ItemPrice (one per catalogue item)internal/domain/itempriceA list price plus sale windows. A sale price is below the list price, windows of one item never overlap (at most 50), the effective price is the lowest active sale price else the list price, and the item must be known and not discontinued in the local catalogue view. WITHDRAWN is final.
DeliveryChargeScheduleinternal/domain/scheduleA charge for every tier (SAME_DAY, NEXT_DAY, TWO_DAY, STANDARD; CONSOLIDATED is optional and free when absent) with an optional free-over threshold. Exactly one is CURRENT; a new version supersedes and must exceed the current one.
TaxTableinternal/domain/taxBasis-point rates by three-character destination postal-prefix bands (at most 500, never overlapping, 0 to 10000 bp). One CURRENT. A synthetic table, not a tax engine.
PriceQuoteinternal/domain/quoteA snapshot of lines, shipment groups, delivery charges, tax and total, pinning the price, schedule and tax-table versions. ISSUED for 15 minutes, then EXPIRED. At most 100 lines, 50 groups, 1000 units per line.
CatalogItemViewtable catalog_items, internal/application/viewsA local read model of which items exist and whether they are discontinued, fed by offer-availability events (ADR 0003). Not aggregate state.

What it does not own​

Out of scopeWhere it belongs
The item master (title, dimensions, flags)offer-availability (retail network): pricing only references catalogItemId
Descriptions, media, categoriesproduct-content
Search, browse, purchasabilityproduct-discovery, which projects ItemPriceChanged and ItemPriceWithdrawn
The non-binding cart estimateshopping-cart, which follows the price, schedule and tax-table events
The purchase saga and quote confirmationcheckout
Authorize, capture, refundcustomer-payments
Delivery dates, capacity, promisesdelivery-promise (retail network): pricing prices a tier, it never sees a promise
Coupons and promotionsa later phase
Real tax calculationa bought tax engine, later
Authenticationnone, fleet-wide: REST and A2A are unauthenticated

Classification and area​

  • Core subdomain. The price of speed per tier is where the network's delivery promise becomes revenue, and cost is the top abandonment reason for shoppers. See Subdomain classification.
  • Storefront area, CloudEvents type prefix com.retailnetwork.storefront.pricing.<entity>.<EventName>. The context consumes the retail network's published events and never calls a restricted network route; it makes no outbound synchronous call at all.

Main capabilities​

  1. Create, change and withdraw item prices (POST /item-prices, PUT /item-prices/{catalogItemId}/list-price, POST /item-prices/{catalogItemId}/withdrawals), with an optimistic version guard.
  2. Schedule and cancel sale windows (POST /item-prices/{catalogItemId}/sales, POST .../sales/{saleId}/cancellations); the effective price is computed at read time and ItemPriceChanged is published when a window opens or closes.
  3. Publish delivery charge schedules and tax tables as new versions and read the current ones.
  4. Issue a binding price quote for a frozen cart (POST /price-quotes) and read it back (GET /price-quotes/{quoteId}), ISSUED or EXPIRED now.
  5. Keep the local catalogue view current from CatalogItemCreated and CatalogItemDiscontinued, withdrawing the price of a discontinued item.
  6. Publish ItemPriceChanged, ItemPriceWithdrawn, DeliveryChargeScheduleChanged and TaxTableChanged on retailnetwork.pricing.events, and PriceQuoteIssued on retailnetwork.pricing.analytics, through the transactional outbox.
  7. Answer two read-only A2A skills, item_price and quote_status (ADR 0007).

Where to go next​

You want toRead
See the layers, binaries and data storesArchitecture
Run it and make the first callsQuickstart
Know every settingConfiguration
Deploy and operate itRunbook, Observability, Before the first release
Fix something that brokeTroubleshooting
Know what tests and CI gates existTesting
See who talks to whomIntegration
See the use cases and their invariantsUse cases
Read the design as ddd-crew artifactsDDD artifacts, Ubiquitous language
Read the contractsAPI overview, Event catalogue
Read the decisionsADR index

Published at https://iqvo.github.io/pricing/. The cross-context view lives in the aggregator site: Storefront.

Disclaimer

This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.