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
| Concept | Where it lives | Rule in one line |
|---|---|---|
| ItemPrice (one per catalogue item) | internal/domain/itemprice | A 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. |
| DeliveryChargeSchedule | internal/domain/schedule | A 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. |
| TaxTable | internal/domain/tax | Basis-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. |
| PriceQuote | internal/domain/quote | A 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. |
| CatalogItemView | table catalog_items, internal/application/views | A 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 scope | Where it belongs |
|---|---|
| The item master (title, dimensions, flags) | offer-availability (retail network): pricing only references catalogItemId |
| Descriptions, media, categories | product-content |
| Search, browse, purchasability | product-discovery, which projects ItemPriceChanged and ItemPriceWithdrawn |
| The non-binding cart estimate | shopping-cart, which follows the price, schedule and tax-table events |
| The purchase saga and quote confirmation | checkout |
| Authorize, capture, refund | customer-payments |
| Delivery dates, capacity, promises | delivery-promise (retail network): pricing prices a tier, it never sees a promise |
| Coupons and promotions | a later phase |
| Real tax calculation | a bought tax engine, later |
| Authentication | none, 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
- Create, change and withdraw item prices (
POST /item-prices,PUT /item-prices/{catalogItemId}/list-price,POST /item-prices/{catalogItemId}/withdrawals), with an optimisticversionguard. - Schedule and cancel sale windows (
POST /item-prices/{catalogItemId}/sales,POST .../sales/{saleId}/cancellations); the effective price is computed at read time andItemPriceChangedis published when a window opens or closes. - Publish delivery charge schedules and tax tables as new versions and read the current ones.
- Issue a binding price quote for a frozen cart (
POST /price-quotes) and read it back (GET /price-quotes/{quoteId}),ISSUEDorEXPIREDnow. - Keep the local catalogue view current from
CatalogItemCreatedandCatalogItemDiscontinued, withdrawing the price of a discontinued item. - Publish
ItemPriceChanged,ItemPriceWithdrawn,DeliveryChargeScheduleChangedandTaxTableChangedonretailnetwork.pricing.events, andPriceQuoteIssuedonretailnetwork.pricing.analytics, through the transactional outbox. - Answer two read-only A2A skills,
item_priceandquote_status(ADR 0007).
Where to go next
| You want to | Read |
|---|---|
| See the layers, binaries and data stores | Architecture |
| Run it and make the first calls | Quickstart |
| Know every setting | Configuration |
| Deploy and operate it | Runbook, Observability, Before the first release |
| Fix something that broke | Troubleshooting |
| Know what tests and CI gates exist | Testing |
| See who talks to whom | Integration |
| See the use cases and their invariants | Use cases |
| Read the design as ddd-crew artifacts | DDD artifacts, Ubiquitous language |
| Read the contracts | API overview, Event catalogue |
| Read the decisions | ADR index |
Published at https://iqvo.github.io/pricing/. The cross-context view lives in the aggregator site: Storefront.
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.