Retail network · Supporting domain · EventStorming board
seller-inbound
Lets a seller plan, pack, label and ship stock to a network node, checks what actually arrives, and advises where to send more.
- events published
- 10
- commands
- 15
- policies
- 13
- read models
- 6
- hot spots
- 5
The story in 6 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventInbound
Plan Confirmed - Pivotal eventInbound
Shipment Labelled - Pivotal eventInbound
Shipment Shipped - Pivotal eventInbound
Shipment Received - Pivotal eventSeller
Suspended - Pivotal eventPlacement
Plan Suggested
Listens to (4): contexts whose events this one reacts to
Tells (3): contexts that react to its events
The board, row by row
16 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
-
Onboard a seller
A network partner manager registers a seller. The seller starts active and can plan inbound shipments straight away. Onboarding an existing seller id is refused.
ActorNetwork partner managerCommandOnboardSeller POST /sellersAggregateAccountEventSellerOnboarded analytics stream onlySource: application/usecases/sellers.go · domain/seller/seller.go
-
Plan an inbound shipment
A seller says what it will send: a node, a packing style (loose or case-packed) and up to 500 item lines in single units. The node must be able to receive. The draft is private to the seller, so nothing is announced.
ActorSellerRead modelNodes that can receiveCommandCreateInbound POST /inbound-plansPlan AggregatePlanSource: application/usecases/plans.go · domain/inboundplan/plan.go
-
Confirm the plan
The seller confirms the draft. The seller must still be active and the node still able to receive. A confirmed plan can be filled by several shipments.
ActorSellerRead modelNodes that can receiveCommandConfirmInbound POST /inbound-plans/{planId}/confirmationsPlan AggregatePlanEventInboundPlan analytics stream onlyConfirmed Source: application/usecases/plans.go · domain/inboundplan/plan.go
-
Pack a carton
The seller adds a carton to a draft shipment. A carton without an SSCC (the standard carton id) gets one issued. It must fit the node's weight and size limits and the plan, and a case carton must match a declared case size.
ActorSellerRead modelPackaging levelsRead modelNodes that can receiveCommandAddCarton POST /inbound-shipments/{shipmentId}/cartonsAggregateShipmentSource: application/usecases/shipments.go · domain/inboundshipment/carton_add.go · domain/inboundshipment/shipment.go
-
Label the shipment
The seller seals the shipment. Contents are frozen and the whole carton list is announced, so the vendor knows what to expect. For a plan with a single shipment the cartons must match every plan line.
ActorSellerCommandLabelShipment POST /inbound-shipments/{shipmentId}/labelsAggregateShipmentEventInboundShipment Labelled Systemvendor-connectivity PolicyKeeps the carton list in the inbound shipment view it serves to vendorsSource: application/usecases/shipments.go · domain/inboundshipment/shipment.go · domain/inboundshipment/events.go
-
Ship the shipment
The seller sends the labelled shipment. It then waits for the vendor's receipt. The seller must still be active and the node still able to receive.
ActorSellerCommandShipInbound POST /inbound-shipments/{shipmentId}/dispatchesShipment AggregateShipmentEventInboundShipment Shipped Systemvendor-connectivity PolicyMarks the shipment as shipped in the view it serves to vendorsSystemnode-performance PolicyKeeps the shipped time, to measure how long the delivery takesSource: application/usecases/shipments.go · domain/inboundshipment/shipment.go · domain/inboundshipment/events.go
-
Check what the vendor received
The vendor reports carton by carton what it found. The first answer per carton is final. Missing, unexpected or damaged cartons and short or over counts are recorded, and each compliance code raised is recorded as a violation.
Systemvendor-connectivity EventInboundReceipt Submitted PolicyWhenever a vendor submits a receipt, apply it carton by carton and record every differenceCommandApplyInbound started by the policyReceipt AggregateShipmentEventInboundDiscrepancy analytics stream onlyRecorded EventSellerCompliance analytics stream onlyViolation Recorded Read model · kept up to dateSeller scorecard factsSource: application/usecases/consumers.go · adapters/inbound/kafka/consumers.go · domain/inboundshipment/receipt.go · domain/scorecard/facts.go
-
Close the shipment
Once every carton on the list has an answer the shipment closes, as clean or with discrepancies. The closing fact lists the stock that really arrived, per item.
Systemvendor-connectivity EventInboundReceipt Submitted PolicyWhenever the last carton gets an answer, close the shipment and announce what arrivedRead modelPackaging levelsCommandApplyInbound started by the policyReceipt AggregateShipmentEventInboundShipment Received Systemoffer-availability PolicyCreates the seller's own listings from the stock that arrivedSystemvendor-connectivity PolicyMarks the shipment as received in the view it serves to vendorsSource: application/usecases/consumers.go · domain/inboundshipment/received.go · domain/inboundshipment/receipt.go · 0014-received-stock-is-published-per-item.md
-
Suspend a seller
A network partner manager suspends a seller. A suspended seller can plan, pack and ship nothing; a shipment already on its way still closes on the vendor's receipt. Suspending twice does nothing.
ActorNetwork partner managerCommandSuspendSeller POST /sellers/{sellerId}/suspensionsAggregateAccountEventSellerSuspended Systemoffer-availability PolicySuppresses the seller's listingsSource: application/usecases/sellers.go · domain/seller/seller.go · 0013-seller-status-is-an-integration-fact.md
-
Reinstate a seller
A network partner manager lifts a suspension. The seller can plan and ship again. Reinstating an active seller does nothing.
ActorNetwork partner managerCommandReinstateSeller POST /sellers/{sellerId}/reinstatementsAggregateAccountEventSellerReinstated Systemoffer-availability PolicyRestores the seller's listingsSource: application/usecases/sellers.go · domain/seller/seller.go · 0013-seller-status-is-an-integration-fact.md
-
Advise where to send more stock
A seller asks where more of one item should go. The advice covers each region with demand in the last 28 days and splits the shortfall over its fulfilment centres. No demand gives an empty plan. A new plan replaces the old one.
ActorSellerRead modelRegional demandRead modelNode availabilityRead modelFulfilment centresCommandComputePlacement POST /placement-plansPlan AggregatePlanEventPlacementPlan Suggested Source: application/usecases/placement.go · domain/placementplan/plan.go · 0012-the-placement-advisory.md
-
Accept the advice
The seller accepts a suggested plan. It is only recorded: nothing downstream changes, and the seller still ships through the normal plan flow.
ActorSellerCommandAcceptPlacement POST /placement-plans/{planId}/acceptancesPlan AggregatePlanSource: application/usecases/placement.go · domain/placementplan/plan.go · 0012-the-placement-advisory.md
-
Keep the list of nodes that can receive
node-topology announces nodes, their inbound limits and their status. This context keeps a copy, so it never asks live. A node it has not seen as active cannot receive.
Systemnode-topology EventNodeRegistered PolicyWhenever a node is registered, declared, activated, suspended or retired, update its rowCommandApplyNode started by the policyRegistered Read model · kept up to dateNodes that can receiveSource: application/usecases/consumers.go · adapters/inbound/kafka/consumers.go · domain/network/network.go
-
Keep the packaging levels
offer-availability announces each item's pack levels: each, case, pallet. Case cartons are checked against them, so the sizes must be known before a case carton can be packed.
Systemoffer-availability EventCatalogItem Packaging Declared PolicyWhenever a pack level is declared or retired, update the packaging levelsCommandApplyPackaging started by the policyDeclared Read model · kept up to datePackaging levelsSource: application/usecases/consumers.go · adapters/inbound/kafka/consumers.go · domain/network/network.go
-
Keep the stock each node declares
offer-availability says how much of an item each node lists. The advice splits a shortfall by this stock.
Systemoffer-availability EventListingAvailability Changed PolicyWhenever a listing's availability changes, keep the latest figure per item and nodeCommandApplyListing started by the policyAvailability Changed Read model · kept up to dateNode availabilitySource: application/usecases/consumers.go · adapters/inbound/kafka/consumers.go · domain/network/demand.go
-
Keep the regional demand (not switched on)
order-sourcing says where order lines were sent. The advice sums them per region. The code exists, but the running service does not start this consumer, so the demand copy stays empty.
Systemorder-sourcing EventFulfillmentReleased To Node PolicyWhenever an order is released to a node, keep its lines as demand for that regionCommandApplyFulfillment started by the policyReleased Read model · kept up to dateRegional demandSource: application/usecases/consumers.go · adapters/inbound/kafka/consumers.go · domain/network/demand.go · ecosystem/integration.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 demand half of the placement advice is never filled: the order-sourcing consumer exists but is not started, so advice comes out empty.
Source: docs/ecosystem/integration.md
- Hot spotA shipped shipment that is never received has no timeout. It stays shipped until a receipt arrives.
Source: docs/ddd/eventstorming.md
- Hot spotCompliance violations are recorded and nothing acts on them. The scorecard is informational and never suspends a seller.
- Hot spotPlan lines are not checked against whether the item is still live, because discontinued items are not followed.
Source: docs/ddd/domain-events.md
- Hot spotAccepting placement advice drives nothing downstream. The seller ships by hand through the normal plan flow.
Opportunities
- OpportunityPlacement optimisation can follow in a later decision, once the advice has consumers.
- OpportunityA minimum number of receipts before a seller's tier counts, if a machine ever reads the tier.
This board is a reconstruction from the code and documentation of seller-inbound at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.