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​

At checkout, delivery-promise tells the shopper a date and proves it with one witness path: a concrete vendor node, its pickup departure, the linehaul legs and a delivery wave that can carry the package in time. That proof is made in milliseconds, for one order, with the network as it looked at that instant.

The witness path is a proof that the promise can be kept. It is not a decision about how it will be kept. Between checkout and the moment a node must start work, the network keeps changing: other orders land on the same cutoff, a departure fills up or is cancelled, a node's scorecard drops, a vendor sends a new inventory feed, a cheaper in-region node appears. Sending every group to its witness node at once would freeze each order's routing at its worst-informed moment.

Order Sourcing owns the later decision. For every shipment group it keeps a FulfillmentAssignment that:

  1. waits, re-optimisable, in a virtual queue until its release point;
  2. at release, sends the group to exactly one node (a purchase order, through vendor-connectivity);
  3. if the node rejects the order or lets it expire, excludes that node and tries the next candidate;
  4. once the node accepts, locks the choice: from then on the node never changes;
  5. if no node can still meet the promise, hands the group back to delivery-promise as UNSOURCEABLE, instead of letting the promise break quietly.

The order assignment model walks through one group end to end with times. This page explains the business reasons.

Why late, and why a lock​

The release point is computed, not configured (VirtualQueue policy):

releaseAt = pickup cutoff of the best candidate
- node handling time
- vendor ack budget
SAME_DAY: release immediately

Releasing later keeps more options open. Releasing too late leaves the vendor no time to acknowledge before it must start handling. The vendor ack budget is the time reserved for that acknowledgement. Same-day groups have no slack, so they skip the queue.

The lock point is the vendor's acceptance (LockOnCommit policy). In a network where the operator picks its own stock, the natural lock point is the pick. Here the fulfillment centres are operated by vendors, and the network cannot see their pick. The acceptance is the first moment the vendor commits, so it is the vendor-node equivalent of "the item is picked" (ADR 0005).

Actors​

ActorKindWhat they do with this context
ShopperPerson (synthetic), indirectPlaces the order in customer-ordering; sees lock, shipment and re-promise only through that context
customer-orderingSibling contextAnnounces placed and cancelled orders; shows the shopper locked, shipped and unsourceable groups
delivery-promiseSibling context (Core)Supplies the promise constraint; re-promises an unsourceable group; signals exhausted promise books
vendor-connectivitySibling contextTurns a release into a purchase order (one order for a merged release) and reports the vendor's acceptance, rejection, expiry and shipment; cancels the order when a release is withdrawn
Vendor nodeExternal organisation, indirectAccepts or rejects the purchase order through the Vendor API. The warehouse-systems fleet is vendor V-WS; its network-fulfillment context is the only fleet system that talks to the network
linehaul-transportationSibling contextSupplies departures and their remaining capacity; follows releases, reassignments, locks and cancellations to expect volume and book the pickup
Network-ops plannerPersonLists and inspects assignments; asks for an immediate re-optimisation; publishes and reads the sourcing policy
TimersSchedulerFire the release at releaseAt and the re-optimisation sweeps over QUEUED assignments

Decisions it makes​

DecisionRule (from business_decisions and policies)
Which node and pathThe cheapest candidate whose eta still meets deliverByLatest: effective cost in cents first (the estimate plus the policy's cross-region surcharge), then legs + crossRegionPenalty + scorecardPenalty + bookPressurePenalty; ties go to the witness node (AssignmentCost, RegionalBudget).
May it differ from the witness?Yes. The only hard constraint is that the assigned path still meets deliverByLatest.
When to releaseAt releaseAt (VirtualQueue); at once for SAME_DAY.
What to sendThe whole group to one node: fill-or-kill. A partial answer does not exist.
What a refusal meansPurchaseOrderRejected or PurchaseOrderExpired excludes that node for the current promise revision and re-queues the group (ReassignOnRefusal).
When the choice is finalOn PurchaseOrderAccepted (LockOnCommit).
When to give upWhen no candidate meets deliverByLatest: UNSOURCEABLE, and delivery-promise re-promises.
Where to look firstIn-region nodes, as a bounded trade: an in-region candidate within the cheapest effective cost plus the policy's deviation percent beats a cross-region one.
Whether to mergeAt release only: groups of one shopper and one address that chose the CONSOLIDATED delivery day may ride in one carrier release, up to the policy's cap, when the window, node, stock and caps allow (ConsolidationAtRelease). A group that does not fit releases alone.
How long to hold a consolidated groupUntil the latest pickup that still reaches the day the shopper chose (ConsolidatedHold).

How this relates to the real fulfillment networks​

The model follows the published description of how a large online retailer separates generating a customer promise from assigning the order to a fulfillment centre, where the assigned centre and path may differ from the path that justified the promise and may change until the item is picked. The sources and quotations are on public fulfillment-network research; this page does not restate them.

Two differences are deliberate and come from the model, not from the source:

  • The fulfillment nodes are vendor-operated (ADR 0004), so a release is a purchase order with an acknowledgement window, close to the vendor direct-fulfillment shape mapped on the vendor platform API surface map. The lock is the acceptance, not the pick.
  • Promise and assignment are two bounded contexts (ADR 0002), joined by the promise constraint on the way in and by FulfillmentUnsourceable and PromiseRevised on the way back.

Order-routing features of commercial order-management products are compared on benchmarks.

Deliberately out of scope​

Not hereWhere it lives
Computing the promise, holding promise-book capacity, judging kept or brokendelivery-promise
The purchase-order protocol: ackBy, fill-or-kill acknowledgement, labels, shipment confirmationvendor-connectivity
Picking, packing and stock placement inside a vendor nodeThe vendor (for V-WS, the warehouse-systems fleet). Which node a seller's stock goes to is chosen on its inbound plan in seller-inbound, not here
Booking the package on the pickup departure, building loadslinehaul-transportation
The tracking timeline, labels and the ship-to addressshipping-and-tracking; no PII ever enters this context (ADR 0006)
Customer cancellation rules and the customer-facing statuscustomer-ordering
Splitting a cart into shipment groupsdelivery-promise (ShipmentGrouping); this context receives groups already formed
Returns, payments, notificationsFuture contexts customer-returns, payments-and-invoicing, customer-notification

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