Retail network · Supporting domain · EventStorming board
vendor-connectivity
The network's front door for vendors: issues purchase orders to vendor-run nodes and takes their answers, labels, shipments, stock feeds, receipts and return outcomes.
- events published
- 12
- commands
- 18
- policies
- 19
- read models
- 5
- hot spots
- 5
The story in 4 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventPurchase
Order Issued - Pivotal eventPurchase
Order Accepted - Pivotal eventVendor
Shipment Confirmed - Pivotal eventInbound
Receipt Submitted
Listens to (5): contexts whose events this one reacts to
Tells (5): contexts that react to its events
The board, row by row
18 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 vendor
A partner manager creates a vendor account and sets how long the vendor has to acknowledge each purchase order. Onboarding the same vendor again returns the existing account.
ActorNetwork partner managerCommandOnboardVendor POST /vendorsAggregateAccountEventVendorOnboarded Source: application/usecases/vendors.go · domain/vendor/vendor.go
-
Suspend a vendor
A partner manager suspends a vendor. While suspended, every write the vendor sends is refused.
ActorNetwork partner managerCommandSuspendVendor POST /vendors/{vendorId}/suspensionsAggregateAccountEventVendorSuspended Source: application/usecases/vendors.go · domain/vendor/vendor.go
-
Reinstate a vendor
A partner manager lifts the suspension and the vendor can write again.
ActorNetwork partner managerCommandReinstateVendor POST /vendors/{vendorId}/reinstatementsAggregateAccountEventVendorReinstated Source: application/usecases/vendors.go · domain/vendor/vendor.go
-
Issue a purchase order
When a group is released to a vendor-run node, one purchase order is issued to that node's vendor. It names the stock owner of every line and the time by which the vendor must answer.
Systemorder-sourcing EventFulfillmentReleased To Node PolicyWhenever a group is released to a vendor-run node, issue one purchase order for itRead modelVendor nodesCommandIssueOn started by the policyRelease AggregatePurchaseOrder EventPurchaseOrder Issued Systemnode-performance PolicyTracks the order for the node's scorecardSource: application/usecases/orders.go · domain/purchaseorder/purchaseorder.go · adapters/inbound/kafka/consumers.go
-
Acknowledge a purchase order
The vendor's system polls its orders, then accepts or rejects the whole order in one call. It must cover every line and answer before the deadline. The call returns a transaction id, not the result.
ActorVendor systemRead modelPurchase ordersCommandSubmitAcknowledgement POST /vendor/acknowledgementsAggregatePurchaseOrder Source: application/usecases/orders.go · domain/purchaseorder/commands_ack.go
-
Settle the vendor's queued writes
A processor runs each queued vendor write once it is due and records the outcome. A successful acknowledgement becomes an accepted or rejected order, a successful shipment confirmation a shipped one.
TimeSubmission processorPolicyWhenever a queued vendor write is due, run it and apply its outcome to the purchase orderCommandProcessSubmission started by the clockAggregateSubmissionEventSubmissionProcessed EventPurchaseOrder Accepted EventPurchaseOrder Rejected EventVendorShipment Confirmed Systemorder-sourcing PolicyLocks the group on acceptance, tries another node on rejection, marks it shippedSystemshipping-and- tracking PolicyRecords a shipment-confirmed scan for each tracking numberSystemnode-performance PolicyCounts the answer and the shipment for the node's scorecardSource: application/usecases/submissions.go · domain/submission/submission.go · domain/purchaseorder/commands_shipment.go
-
Expire an order nobody answered
A sweep finds issued orders past their acknowledge-by time. They expire so order-sourcing can try another node.
TimeExpiry sweepPolicyEvery sweep, an issued order past its acknowledge-by time expiresCommandExpireUnacknowledged started by the clockAggregatePurchaseOrder EventPurchaseOrder Expired Systemorder-sourcing PolicyExcludes the node and searches againSystemnode-performance PolicyCounts the missed deadline for the node's scorecardSource: application/usecases/orders.go · domain/purchaseorder/purchaseorder.go
-
Cancel an order when sourcing cancels
When order-sourcing cancels a group, its purchase order is cancelled, but only while it still waits for the vendor's answer. After the vendor answered, the order stays and the refusal is only logged.
Systemorder-sourcing EventFulfillmentCancelled PolicyWhenever a group is cancelled, cancel its purchase order if it is still waiting for an answerCommandCancelOn started by the policySourcing Cancel AggregatePurchaseOrder EventPurchaseOrder analytics stream onlyCancelled Source: application/usecases/orders.go · domain/purchaseorder/purchaseorder.go
-
Cancel an order when a release is withdrawn
When order-sourcing withdraws a merged release, the purchase order of exactly that release is cancelled, never a newer one for the same group.
Systemorder-sourcing EventFulfillmentRelease Withdrawn PolicyWhenever a release is withdrawn, cancel the purchase order of that release if it is still waitingCommandCancelOn started by the policyRelease Withdrawn AggregatePurchaseOrder EventPurchaseOrder analytics stream onlyCancelled Source: application/usecases/orders_withdrawn.go · 0013-cancel-the-purchase-order-when-a-release-is-withdrawn.md
-
Request shipping labels
For an accepted order the vendor asks for one label per package. This is the one write answered at once: one label is issued per package by shipping-and-tracking, and labels already issued are returned again.
ActorVendor systemCommandRequestLabel POST /vendor/shipping-labelsAggregatePurchaseOrder Systemshipping-and- tracking PolicyIs called right away to issue one label per packageSource: application/usecases/orders.go · domain/purchaseorder/commands_labels.go
-
Confirm a shipment
The vendor confirms that an accepted order shipped. The tracking numbers must be exactly the ones of the labels issued; the confirmation is queued and settled later.
ActorVendor systemCommandSubmitShipment POST /vendor/shipment-confirmationsConfirmation AggregatePurchaseOrder Source: application/usecases/orders.go · domain/purchaseorder/commands_shipment.go
-
Register a node or send its stock
The vendor registers a node, declares its operating profile or sends an inventory feed. Each write is queued and settled later; node-topology and offer-availability do the real work and the answer carries the new node id.
ActorVendor systemCommandRegisterVendor POST /vendor/nodesNode AggregateSubmissionSource: application/usecases/submissions.go · domain/submission/submission.go
-
Report what the dock received
The vendor reports cartons received for an inbound shipment. The report is checked against the shipment's manifest; counting more or fewer units than listed is reported, never refused.
ActorVendor systemRead modelInbound shipments copyCommandSubmitInbound POST /vendor/inbound-receiptsReceipt AggregateReceiptEventInboundReceipt Submitted Systemseller-inbound PolicyRecords the findings and closes the inbound shipmentSystemnode-performance PolicyUses the carton findings for the node's inbound accuracy scoreSource: application/usecases/inbound.go · domain/inbound/receipt.go · 0005-inbound-shipments-receipts-and-catalog-packaging.md
-
Keep the inbound shipments copy
Seller-inbound announces shipments with their carton manifests. A copy lets the vendor poll what is on its way and lets receipts be checked without a live call.
Systemseller-inbound EventInboundShipment Shipped PolicyWhenever an inbound shipment is labelled, shipped or received, update the local shipments copyCommandOnInbound started by the policyShipment Shipped Read model · kept up to dateInbound shipments copySource: application/usecases/inbound.go · adapters/inbound/kafka/inbound_consumers.go
-
Keep the return advices copy
Customer-returns announces each authorized return. It becomes an advice for the vendor that runs the receiving node, so the vendor can poll what is coming back. Labels add tracking numbers; a cancel closes it.
Systemcustomer-returns EventReturnAuthorized PolicyWhenever a return is authorized, labelled or cancelled, update the local return advices copyRead modelVendor nodesCommandOnReturn started by the policyAuthorized Read model · kept up to dateReturn advices copySource: application/usecases/returns.go · 0014-return-advices-and-outcomes.md
-
Report a return outcome
The returns centre reports, per item, how many units can be restocked and how many cannot. The advice then leaves the poll. Items the advice never listed are not refused: goods on the dock are never turned away.
ActorVendor systemRead modelReturn advices copyCommandSubmitReturn POST /vendor/return-outcomesOutcome AggregateAdviceEventVendorReturn Outcome Submitted Systemcustomer-returns PolicyCompletes the return so good units are restocked; items it never authorized are recorded, not restockedSource: application/usecases/returns.go · domain/returns/returns.go · 0014-return-advices-and-outcomes.md
-
Keep the vendor node list
Node-topology announces nodes, profiles and status changes. A copy tells which nodes belong to which vendor and each node's handling time, used to set the answer deadline.
Systemnode-topology EventNodeActivated PolicyWhenever a node is registered, profiled, activated, suspended or retired, update the local node listCommandOnNode started by the policyStatus Read model · kept up to dateVendor nodesSource: application/usecases/queries.go · adapters/inbound/kafka/consumers.go
-
Keep the listings and packaging copy
Offer-availability announces listings and the pack levels of each catalogue item. Listings let stock feeds be checked; pack levels appear on purchase order lines.
Systemoffer-availability EventListingCreated PolicyWhenever a listing is created, keep it so a stock feed can be checked against its nodeCommandOnListing started by the policyCreated Read model · kept up to dateListingsSource: application/usecases/queries.go · adapters/inbound/kafka/consumers.go
Hot spots and opportunities
Open questions and known gaps, each taken from a decision record or a document in the repository, never invented.
- Hot spotA cancel that arrives after the vendor answered is refused and only logged: nobody is told, and the vendor may still ship.
Source: docs/ddd/eventstorming.md
- Hot spotThe vendor's identity is a request field, not authentication. The ownership check only keeps a vendor away from other vendors' nodes inside the cluster.
Source: docs/ddd/eventstorming.md
- Hot spotA withdrawn release can be accepted in the one message hop before the cancel arrives: the vendor then holds an order for the old merged lines.
Source: adr/0013-cancel-the-purchase-order-when-a-release-is-withdrawn.md
- Hot spotA receipt is judged when it is sent, not again when processed, so two receipts for one shipment can both be accepted.
Source: adr/0005-inbound-shipments-receipts-and-catalog-packaging.md
- Hot spotThe vendor-account events (onboarded, suspended, reinstated) have no consumer that acts on them yet.
Source: apis/asyncapi.yaml
This board is a reconstruction from the code and documentation of vendor-connectivity at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.