Skip to main content

Business Context

As built

Derived from network/model/model.yaml. This context's service is built; the model carries its as-built contracts, and identifiers (Err... names, routes, CloudEvents types) are the names the service uses.

The problem in plain language​

A shopper has a cart and an address. The network must answer two questions before it takes the money in a real shop (payment is out of scope here): can we deliver this, and by when? Then it must remember what was promised, show progress, and let the shopper change their mind while that is still cheap.

The first question is not answered here. delivery-promise owns the delivery date and the capacity behind it. Customer Ordering only asks: for each shipment group, it turns the delivery offer the shopper saw into a promise (MakePromise). If the offer has expired, it asks for a new quote (QuoteDeliveryOffers) and shows the new window before placing anything. The rule is strict: no order is placed unless every line belongs to exactly one promise that can still be confirmed (ErrLineWithoutPromise).

What this context does own is the transaction record:

It ownsWhy here
The customer order: lines, the promise per shipment group, the customer-facing statusSomeone must hold "what the shopper bought and what we told them" as one record.
The ship-to address and the shopper account (synthetic PII)PII is confined to one context and read by exactly one other, shipping-and-tracking, for the label (ADR 0006).
Customer cancellationOnly this context knows the shopper asked; it tells sourcing and promising.
The tracking viewOne customer-facing timeline assembled from three upstream streams.

Actors​

ActorWhat they do hereChannel
Shopper (synthetic), through the storefrontRegisters, checks out, reads the order and its tracking, cancelsREST POST /shoppers, POST /checkout, GET /orders/{orderId}, GET /orders/{orderId}/tracking, POST /orders/{orderId}/cancellations
e2e-tests and the console remoteDrive the same storefront API as the shopperthe same REST routes
delivery-promiseQuotes offers and makes promises for checkout; later reports a promise at risk, revised, kept or brokensync REST (called by us); Kafka (consumed by us)
order-sourcingReports when a group is locked to a node, shipped, or unsourceableKafka
shipping-and-trackingReads the ship-to address to print a label; reports labels, scans, delivery and exceptionssync REST (calls us); Kafka

Decisions this context makes​

The model lists three business decisions (contexts[customer-ordering].business_decisions):

  1. No order without a promise per group. Every line is in exactly one shipment group, and every group has a promise (ErrLineWithoutPromise). The promise must be for the ship-to's destination postal prefix (ErrPromiseDestinationMismatch).
  2. The ship-to address never leaves this context, except to shipping-and-tracking for a label, through the restricted route GET /orders/{orderId}/ship-to. No event this context publishes carries it; CustomerOrderPlaced carries only destinationPostalPrefix.
  3. Cancellation ends at the lock. A customer may cancel only the shipment groups that no node has locked yet; a request with every group locked, shipped or delivered is refused (ErrCancelAfterLock). After that, cancellation is a return, which is a future context (customer-returns). A cancel is a request: order-sourcing decides per group (customer-ordering ADR 0002 A3). The model words this decision as "until every shipment group is locked", while the invariant and the service act on the unlocked groups.

It also runs two policies: CheckoutPromising (promise each group from the offer the shopper saw; re-quote if it expired) and CancelOnUnfulfillable (cancel a group at once when delivery-promise publishes PromiseUnkeepable for it and no node has locked it, and the order if nothing remains).

How it relates to the real fulfillment networks​

The research pages describe how a large online retailer's network separates the customer-facing order from the delivery promise and from the decision of which building ships it. See public fulfillment-network research. They also describe the vendor-facing surface, where a purchase order never carries the end customer's account. See the the vendor platform API surface map. This model copies the shape, not any internal service name:

  • The storefront order is a commodity: every shop has one. What makes the network different is the promise behind it (delivery-promise, Core) and late assignment (order-sourcing, Core). That is why this context is Generic.
  • The order record is where the customer's identity and address live. The vendor sees a purchase order in network terms only (vendor-connectivity). The label printer is the one place that needs the address (shipping-and-tracking).

Deliberately out of scope​

Out of scopeWhere it belongs
Computing delivery dates, holding capacity, judging kept or brokendelivery-promise
Choosing the shipping node, releasing to it, the path lockorder-sourcing
Catalogue browsing and availabilityoffer-availability (the storefront queries it directly)
Labels and the package journeyshipping-and-tracking
Returns after the lockfuture customer-returns
E-mail and push notifications on a revised promise or a deliveryfuture customer-notification (Generic, buy)
Payments, invoices, taxfuture payments-and-invoicing
Authentication and real PIIno auth anywhere (conventions.no_auth); PII is synthetic
Anything in the warehouse-systems fleetThis context never touches the fleet. The only seam between the two organizations is the Vendor API (Vendor API).

See the Bounded Context Canvas for every message and the Context Map for every relationship.