Warehouse execution (WES) · Supporting domain · EventStorming board
network-fulfillment
The seam to the external retail network: answers its purchase orders in time, tells it what the building can ship, and reports what the dock received.
- events published
- 7
- commands
- 15
- policies
- 26
- read models
- 13
- hot spots
- 5
The story in 4 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventNetwork
Order Received - Pivotal eventNetwork
Order Submitted - Pivotal eventNetwork
Order Acknowledged - Pivotal eventNetwork
Order Shipment Confirmed
Listens to (4): contexts whose events this one reacts to
Tells (1): contexts that react to its events
The board, row by row
17 rows, in the order the business story happens: the main path first, then how this context reacts to the others, then the clock. Rows are small stories; read each one left to right.
- Event
- Command
- Actor
- Aggregate
- Policy
- Read model
- External system
- Hot spot
- Opportunity
-
Take a purchase order and hold the stock
A new purchase order is recorded and its products are translated to our SKUs. order-management holds the stock and promises a ship date. If the date is feasible, the whole order is accepted.
System · outsideRetail networkEventPurchase order issuedPolicyWhenever a poll finds a new purchase order, record it and start its answer clockRead modelProduct dictionaryRead modelShip-by promise from order-managementCommandReceiveNetwork a background jobDemand AggregateNetworkOrder EventNetworkOrder Received EventNetworkOrder Submitted System · outsideRetail networkPolicyIs told the whole order is accepted; it is settled laterSource: application/usecases/receive_network_demand.go · adapters/inbound/poller/poller.go · adapters/outbound/ordermanagement/planner.go · domain/networkorder/network_order.go
-
Refuse an order we cannot take
One unknown product, or a ship-by date the building cannot meet, refuses the whole order. Any stock already held is freed and the network is told no, with the reason.
System · outsideRetail networkEventPurchase order issuedPolicyWhenever a purchase order has an unknown product or an infeasible date, refuse all of itRead modelProduct dictionaryRead modelShip-by promise from order-managementCommandReceiveNetwork a background jobDemand AggregateNetworkOrder EventNetworkOrder Received EventNetworkOrder Rejected System · outsideRetail networkPolicyIs told no, with the reason (unknown listing or cannot meet ship-by)Source: application/usecases/receive_network_demand.go · adapters/outbound/producttranslation/dictionary.go · domain/networkorder/network_order.go
-
Settle an accepted order
The network confirms or refuses an answer later. On success the order is acknowledged and the held stock is released. On failure the hold is freed and the order is refused.
TimeSettle passPolicyEvery pass, ask the network about each accepted order: success settles it, failure refuses it, pending waitsRead modelOrders awaiting settlementRead modelNetwork's status for each answerCommandReconcileSubmitted started by the clockOrders AggregateNetworkOrder EventNetworkOrder Acknowledged EventNetworkOrder Rejected Source: application/usecases/reconcile_submitted_orders.go · domain/networkorder/network_order.go · 0016-cloudevents-submitted-and-settle-time-acknowledged.md
-
Confirm orders when the load ships
outbound-shipping announces that a load shipped. Each network order on it is confirmed the way an operator would, so a repeat confirms nothing twice. An order still waiting for the network's answer is noted and confirmed later; one we do not hold is skipped.
Systemoutbound-shipping EventShipmentConfirmed PolicyWhenever a load is confirmed as shipped, confirm the network orders on itRead modelAcknowledged ordersCommandConfirmNetwork started by the policyOrder Shipment AggregateNetworkOrder EventNetworkOrder Shipment Confirmed System · outsideRetail networkPolicyIs sent the label request and then the shipment confirmationSource: adapters/inbound/kafka/shipment_confirmed_consumer.go · application/usecases/confirm_network_order_shipment.go · 0014-explicit-shipment-confirmation-endpoint.md
-
Confirm a shipment noted before the answer
A load can leave while its order still waits for the network's answer, so the order notes the shipment. A timer later confirms it once the order is acknowledged, or drops it if the order was refused or is already confirmed.
TimeNoted-shipment timerPolicyEvery pass, confirm a noted shipment once its order is acknowledged, and drop it if the order needs no confirmationRead modelOrders with a noted shipmentCommandConfirmPending started by the clockShipments AggregateNetworkOrder EventNetworkOrder Shipment Confirmed System · outsideRetail networkPolicyIs sent the label request and then the shipment confirmationSource: application/usecases/confirm_pending_shipments.go · application/usecases/defer_shipment_confirmation.go · domain/networkorder/pending_shipment.go · 0014-explicit-shipment-confirmation-endpoint.md
-
Confirm that an order shipped, by hand
An operator can confirm an acknowledged order as shipped without waiting for the event. The network gets a label request first. This route is kept as the fallback.
ActorOperatorRead modelAcknowledged ordersCommandConfirmNetwork POST /network-orders/{networkRef}/shipment-confirmationOrder Shipment AggregateNetworkOrder EventNetworkOrder Shipment Confirmed System · outsideRetail networkPolicyIs sent the label request and then the shipment confirmationSource: application/usecases/confirm_network_order_shipment.go · adapters/inbound/kafka/shipment_confirmed_consumer.go · 0014-explicit-shipment-confirmation-endpoint.md
-
Report an order past its answer deadline
A sweep finds orders still unanswered after their deadline and reports each one on every pass. It never changes the order itself.
TimeDeadline sweepPolicyEvery sweep, report each unanswered order that is past its deadline, and leave the order unchangedRead modelUnanswered ordersCommandSweepAcknowledgement started by the clockDeadlines AggregateNetworkOrder EventAcknowledgementDeadline At Risk Systemexception-management PolicyOpens an exception for the order, or adds to the one already openSource: application/usecases/sweep_acknowledgement_deadlines.go · domain/networkorder/network_order.go
-
Refuse an order nobody answered in time
A separate sweep refuses orders whose deadline passed unanswered, and frees the held stock if there is a hold. An overdue order is never answered late.
TimeOverdue sweepPolicyEvery sweep, refuse each unanswered order that is past its deadline and free its held stockRead modelUnanswered ordersCommandRejectOverdue started by the clockOrders AggregateNetworkOrder EventNetworkOrder Rejected Source: application/usecases/reject_overdue_orders.go · domain/networkorder/network_order.go
-
Free a hold nobody decided
order-management never times out a held order, so this context does. An open hold well past the deadline is cancelled and reported. The order's own state is left alone.
TimeOrphaned-hold sweepPolicyEvery sweep, cancel any open hold that is past its deadline plus a grace periodRead modelOpen holdsCommandSweepOrphaned started by the clockHolds AggregateNetworkOrder EventOrphanedHold Cancelled Systemexception-management PolicyOpens an exception for the order, or adds to the one already openSource: application/usecases/sweep_orphaned_holds.go · domain/networkorder/hold.go · 0024-orphaned-order-management-hold-sweep.md
-
Keep the cutoff schedule copy
process-path-management announces process paths and their cutoff schedules. A local copy of the cutoffs and path cycle times lets offers and the site profile be worked out without a live call.
Systemprocess-path- management EventCPTScheduleChanged PolicyWhenever a path or its cutoff schedule changes, update the local copyCommandApplySchedule started by the policyRead model · kept up to dateCutoff schedule and path timesSource: adapters/outbound/processpathcache/consumer.go · adapters/outbound/processpathcache/schedule.go
-
Keep the path capacity copy
wes-work-planning announces how much capacity is left on each path before each cutoff. A local copy lets offers and cutoff ceilings be worked out without a live call.
Systemwes-work- planning EventPathCapacity Changed PolicyWhenever a path's remaining capacity changes, update the local copyCommandApplyPath started by the policyCapacity Changed Read model · kept up to dateRemaining capacity per path -
Work out what we could offer
For each known SKU the offer is the lower of the stock usable now and what the paths can still handle before the next feasible cutoff. Unknown capacity falls back to stock.
TimeRecompute passPolicyEvery pass, work out an offer per SKU from usable stock and the capacity before the next cutoffRead modelProduct dictionaryRead modelCutoff schedule and path timesRead modelRemaining capacity per pathCommandRecomputeCapability started by the clockOffers AggregateCapabilityOffer Read model · kept up to dateCapability offersSource: application/usecases/recompute_capability_offers.go · domain/capabilityoffer/capability_offer.go · 0031-advertise-against-the-next-feasible-cutoff.md
-
Tell the network how the building works
In live mode, each site's cutoffs, handling time and order ceilings are derived from the local copies and declared to the network. A new revision is sent only when the content changed.
TimeProfile passPolicyEvery pass, declare each site's operating profile to the network, but only if it changedRead modelCutoff schedule and path timesRead modelRemaining capacity per pathCommandDeclareNode started by the clockProfiles System · outsideRetail networkPolicyLearns each site's cutoffs, handling time and order ceilingsSource: application/usecases/declare_node_profiles.go · application/usecases/profile_derivation.go · 0027-supply-loop-node-profile-and-inventory-feed.md
-
Tell the network what we can ship
In live mode, the saved offers become an inventory feed per site. The feed is sent when it changed, and repeated at most hourly when it did not.
TimeInventory feed passPolicyEvery pass, send each site's offers for the items the site lists, when they changedRead modelCapability offersRead modelProduct dictionaryCommandFeedInventory started by the clockSystem · outsideRetail networkPolicyLearns how many of each listed item the site can shipSource: application/usecases/feed_inventory.go · application/usecases/feed_plan.go · 0027-supply-loop-node-profile-and-inventory-feed.md
-
Announce a seller shipment to receiving
In live mode, shipments the network says are on their way are recorded. Each one is registered in inbound-receiving as an expected delivery before the truck arrives. Failures are retried with a growing wait.
System · outsideRetail networkEventSeller shipment announcedPolicyWhenever a poll finds a shipped seller shipment, record it and register an expected deliveryRead modelProduct codes (GTIN to SKU)CommandIntakeInbound a background jobShipments Source: application/usecases/intake_inbound_shipments.go · adapters/outbound/inboundreceiving/client.go · 0028-inbound-loop-seller-shipments-and-receipts.md
-
Keep a copy of the receipts at the dock
inbound-receiving announces each accepted carton, each carton finding and each closed receipt. A local copy keeps only the deliveries this context announced, so the result can be reported later.
Systeminbound-receiving EventReceiptClosed PolicyWhenever a receipt closes, keep it with its cartons and findings, but only for our own deliveriesCommandRecordClosed started by the policyRead model · kept up to dateReceipt facts for our deliveriesSource: adapters/inbound/kafka/receipt_consumer.go · adapters/outbound/postgres/receipt_projection_repo.go · 0028-inbound-loop-seller-shipments-and-receipts.md
-
Report what the dock received
Each closed receipt is turned into a per-carton result: received, damaged, missing or unexpected, with any findings. It is sent to the network exactly once per shipment.
TimeReceipt return passPolicyEvery pass, report each closed receipt not yet reported, retrying with a growing waitRead modelReceipt facts for our deliveriesCommandReturnInbound started by the clockReceipts System · outsideRetail networkPolicyIs told what arrived, carton by carton, with the findingsSource: application/usecases/return_inbound_receipts.go · 0028-inbound-loop-seller-shipments-and-receipts.md
Hot spots and opportunities
Open questions and known gaps, each taken from a decision record or a document in the repository, never invented. Opportunities are improvements the documentation already names.
- Hot spotThe deadline warning fires only after the answer deadline has passed. The decision record says it should fire as the deadline approaches.
- Hot spotIf releasing the held stock fails after an order settles, nothing retries it: the order no longer counts as awaiting settlement.
Source: docs/ddd/use-cases.md
- Hot spotThe network is always told one package per order, because the shipped-load fact carries no per-order package count yet.
- Hot spotRemaining capacity is counted as one order per unit, so a declared cutoff ceiling can be too high until the network corrects it.
Source: adr/0027-supply-loop-node-profile-and-inventory-feed.md
- Hot spotDock findings with no carton label (unknown product, unlabelled carton) cannot be reported to the network. They are only logged.
Source: adr/0028-inbound-loop-seller-shipments-and-receipts.md
Opportunities
- Opportunityoutbound-shipping could add a per-order package count to its shipped-load fact. The consumer already tolerates it, so the real count would flow.
- OpportunityPack levels from the network's listings could be declared to product-master once the open question of which side owns a product code is settled.
Source: adr/0028-inbound-loop-seller-shipments-and-receipts.md
This board is a reconstruction from the code and documentation of network-fulfillment at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.