Skip to main content

Bounded Context Canvas

Built on develop, not deployed

Derived from model/model.yaml. The pricing service is built on develop (IQVO/pricing at 5a18326, checked 2026-10-27) and not deployed (no warehouse-infra entry). Every Err... name, REST route and CloudEvents type of this context named on this page exists in the service; where the built service differs from the model's design, the page says so (As built) or the context's Service and operations section lists it.

Following the ddd-crew Bounded Context Canvas v5. Every message row comes from contexts[pricing] (inbound, consumes, publishes, rest) or from a neighbour's entry that names this context. sync_calls is empty: pricing calls nobody.

Canvas at a glance​

Two pictures of the sections below, laid out like the ddd-crew canvas: first the inbound collaborators feeding this context (purpose, domain roles and the business decisions it enforces), then the outbound collaborators it notifies. Arrows follow the message type: solid blue commands (cmd), dotted green queries (qry), thick orange events (evt); each arrow names its channel and the messages it carries. Box shapes mark the collaborator kind: rounded = people, UI or any client; blue = sibling bounded context. Channel names on the arrows are abbreviated; the Inbound and Outbound Communication tables carry the exact route, topic and CloudEvents type for every message.

Inbound​

Outbound​

Derived from: model.yaml → contexts[pricing].inbound, .publishes, .purpose, .roles, .business_decisions; contexts[product-discovery].inbound, contexts[shopping-cart].inbound (rows from pricing).

The diagrams omit assumptions, verification metrics, open questions and the ubiquitous language (sections below), the relationship pattern per message (see the tables), and the synchronous replies. Pricing has no outbound synchronous call: sync_calls is empty.

Name​

Pricing (pricing, code PR, CloudEvents tier storefront).

Purpose​

To own what a shopper pays. The context:

  • keeps the list price and sale windows of every catalogue item, versioned, with the effective price derived (lowest active sale, else list);
  • prices each delivery service tier (SAME_DAY, NEXT_DAY, TWO_DAY, STANDARD) with an optional free-over threshold;
  • holds the synthetic tax table by postal-prefix band;
  • issues the binding, immutable, expiring PriceQuote a checkout session is confirmed against, pinning the price, schedule and tax-table versions it was computed from.

Strategic Classification​

AxisVerdict
DomainCore subdomain. See the Core Domain Chart.
Business ModelRevenue (the price of speed per tier is where the network's promise becomes revenue).
EvolutionCustom-built.

Domain Roles​

RoleApplies?Evidence in the model
Specification (price of an item, charge of a tier)Yes, primaryItemPrice, DeliveryChargeSchedule, TaxTable with their invariants; the read routes every other surface renders from.
Execution (price quotes)YesIssuePriceQuote, ExpireQuote, the PriceQuote aggregate and QuoteTtl.
AnalysisNoNo read model here is a decision input for another context; CatalogItemView is an enforcement input.
GatewayNoThe storefront edge is storefront-bff, the experience layer; pricing is one of the contexts behind it, and shoppers never read it directly (they see prices through product-discovery).

Inbound Communication​

CollaboratorMessageTypeChannelRelationship
Storefront merchandiser (human)SetListPriceCommandREST POST /item-prices, PUT /item-prices/{catalogItemId}/list-priceUI
Storefront merchandiser (human)ScheduleSale, CancelSaleCommandREST POST /item-prices/{catalogItemId}/sales, POST /item-prices/{catalogItemId}/sales/{saleId}/cancellationsUI
Storefront merchandiser (human)WithdrawPriceCommandREST POST /item-prices/{catalogItemId}/withdrawalsUI
Storefront merchandiser (human)PublishChargeScheduleCommandREST POST /delivery-charge-schedulesUI
Storefront merchandiser (human)PublishTaxTableCommandREST POST /tax-tablesUI
Storefront merchandiser (human)GetItemPriceQueryREST GET /item-prices/{catalogItemId}UI
Storefront merchandiser (human)GetCurrentChargeScheduleQueryREST GET /delivery-charge-schedules/currentUI
Storefront merchandiser (human)GetCurrentTaxTableQueryREST GET /tax-tables/currentUI
checkoutIssuePriceQuoteCommandREST POST /price-quotesCustomer/Supplier (we are the Supplier)
checkoutGetPriceQuoteQueryREST GET /price-quotes/{quoteId}Customer/Supplier (we are the Supplier)
product-discoveryListItemPricesQueryREST GET /item-prices (bootstrap and rebuild only, paged)Customer/Supplier (we are the Supplier)
offer-availability (network)CatalogItemCreatedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemCreatedConformist
offer-availability (network)CatalogItemDiscontinuedEventKafka retailnetwork.offer-availability.events, com.retailnetwork.commerce.offer-availability.catalogitem.CatalogItemDiscontinuedConformist

Route-to-command note: the model's inbound row for the merchandiser names the route groups, not one route per command; the mapping above is this pack's reading of rest against commands (see Open Questions).

Outbound Communication​

CollaboratorMessageTypeChannelRelationship
product-discovery, shopping-cartItemPriceChangedEventKafka retailnetwork.pricing.events, com.retailnetwork.storefront.pricing.itemprice.ItemPriceChangedConformist (product-discovery) / Customer/Supplier (shopping-cart)
product-discovery, shopping-cartItemPriceWithdrawnEventKafka retailnetwork.pricing.events, com.retailnetwork.storefront.pricing.itemprice.ItemPriceWithdrawnConformist (product-discovery) / Customer/Supplier (shopping-cart)
shopping-cartDeliveryChargeScheduleChangedEventKafka retailnetwork.pricing.events, com.retailnetwork.storefront.pricing.deliverychargeschedule.DeliveryChargeScheduleChangedCustomer/Supplier (we are the Supplier)
shopping-cartTaxTableChangedEventKafka retailnetwork.pricing.events, com.retailnetwork.storefront.pricing.taxtable.TaxTableChangedCustomer/Supplier (we are the Supplier)
analytics onlyPriceQuoteIssuedEventKafka retailnetwork.pricing.analytics, com.retailnetwork.storefront.pricing.pricequote.PriceQuoteIssuedanalytics stream

What the consumers do with them (from their own model entries): product-discovery refreshes the price fields of ProductView (monotonic guard on the price version) and its purchasable flag; shopping-cart refreshes PurchasabilityView and recomputes the labelled, non-binding EstimateView. Relationship evidence: Context Map.

Ubiquitous Language​

Full glossary: Ubiquitous Language. Top terms: List Price, Sale Window, Effective Price, Delivery Charge, Tax Band, Price Quote (binding; not the cart Estimate).

Business Decisions​

  1. A sale price is always below the list price (ErrSaleNotBelowList) and sale windows of one item never overlap (ErrOverlappingSaleWindow). The effective price needs no tie-break.
  2. Exactly one charge schedule and one tax table are current; a new version supersedes, never edits (ErrNonIncreasingVersion). A quote can always name the versions it used.
  3. A PriceQuote is binding, immutable and expiring (QuoteTtl, default 15 minutes). The review page shows the binding total; a changed total is visible before confirm (gap S2).
  4. The item master stays in offer-availability. A price exists only for a known, not discontinued item (ErrUnknownCatalogItem), enforced against the local CatalogItemView.
  5. Money is integer minor units of one configured currency; every amount is non-negative (ErrNegativeAmount) and single-currency (ErrCurrencyMismatch).
  6. A discontinued item's price is withdrawn (WithdrawOnDiscontinue), so no surface keeps selling what the network retired.

Assumptions​

  • offer-availability publishes CatalogItemCreated before pricing can be asked to price the item; an earlier SetListPrice fails ErrUnknownCatalogItem and the merchandiser retries.
  • The merchandiser's UI and the consumers tolerate the outbox lag between a price decision and ItemPriceChanged; sale boundaries are published by PublishEffectivePriceOnWindowBoundary, idempotent per item and boundary.
  • checkout opens the quote, shows it and confirms within QuoteTtl; its own ExpireOnQuoteExpiry policy mirrors the TTL, because pricing publishes no expiry event (see Open Questions).
  • Every consumed event is applied once (inbox on the CloudEvents id).
  • One configured currency everywhere (conventions.integration_rules).

Verification Metrics​

MetricTarget (proposed)Source
POST /price-quotes success ratetracked; alert on a dropREST access log
Share of IssuePriceQuote rejected ErrItemNotPricedabout 0 once checkout checks purchasabilityREST access log
Quotes confirmed after expiresAt (checkout's ErrPriceQuoteExpired)tracked; drives the QuoteTtl valuecheckout metrics
Sale-boundary ItemPriceChanged emitted at the boundary minute100% (idempotent per item and boundary)scheduler log vs outbox
CatalogItemView lag behind retailnetwork.offer-availability.eventsbelow 30 sKafka consumer metrics
Outbox age of the oldest unpublished pricing eventbelow 5 soutbox_events.created_at
Prices on items the view has discontinued but not yet withdrawn0 after WithdrawOnDiscontinue lagjoin of CatalogItemView and ItemPrice

Open Questions​

  • Resolved in the model-fix: WithdrawPrice has the route POST /item-prices/{catalogItemId}/withdrawals; CancelSale raises no event of its own (the window-boundary policy emits ItemPriceChanged for the reverted price); quote expiry is checkout-internal TTL state with no PriceQuoteExpired event; the schedule and the tax table have the states CURRENT then SUPERSEDED; IssuePriceQuote lists its request fields (cartId, lines, groups, destinationPostalPrefix); GET /item-prices is bootstrap and rebuild only, and shoppers see prices through product-discovery's ProductView.