Skip to main content

EventStorming

Process-level boards in the ddd-crew EventStorming glossary & cheat sheet notation. Every sticky is a command, aggregate, event, policy or read model of the built service. Hotspots are the gaps the aggregator's model raised; the inventory at the end says which the code resolved and which stay open. The boards read top to bottom (flowchart TB) so each stays inside the page width. The network-wide board is on EventStorming big picture.

Legend​

StickyColourMeaning
Commandblue #a5d8ffAn intent: a vendor write, a policy's action, a sweep
Aggregateyellow #ffec99VendorAccount, PurchaseOrder, Submission
Domain Eventorange #ffc078A published fact of this context, or a consumed fact of a neighbour
Policylilac #d0bfff"Whenever X, then Y"
Read Modelgreen #b2f2bbVendorNodeView, ListingView, or a query the vendor reads
External Systempink #fcc2d7The vendor (the fleet) or a sibling context
Hotspotred #ff8787A gap or open question; marked resolved where the code settled it
Actorpale yellow #fff59dA person or a timer

Source: internal/application/usecases/service.go and internal/domain/*/events.go.

1. Issue and acknowledge​

Source: internal/application/usecases/orders.go (IssueOnRelease, SubmitAcknowledgement) and internal/domain/purchaseorder/events.go.

Omitted: the synchronous refusals at receipt (ErrPartialAcknowledgement, ErrAlreadyAcknowledged, ErrAckWindowClosed, ErrNodeNotOwnedByVendor), shown on Use Cases; the PO_REDELIVERY_RATE re-delivery on poll.

2. Transaction outcomes​

Source: internal/application/usecases/submissions.go (ProcessDueSubmissions, finish) and internal/domain/*/events.go.

Omitted: node-performance also consumes PurchaseOrderAccepted, PurchaseOrderRejected and VendorShipmentConfirmed; the relay kinds (INVENTORY, NODE_REGISTRATION, NODE_PROFILE) are on board 5, and inbound receipts (a sixth kind, ADR 0005) and return outcomes (a seventh kind, ADR 0014) are not drawn here.

3. The clock and cancellation​

Source: internal/application/usecases/orders.go (ExpireUnacknowledged, CancelOnSourcingCancel) and cmd/api/background.go.

Omitted: node-performance also consumes PurchaseOrderExpired.

4. Labels and shipment​

Source: internal/application/usecases/orders.go (RequestLabel, SubmitShipmentConfirmation) and internal/domain/purchaseorder/events.go.

Omitted: LabelIssued, which shipping-and-tracking publishes and this context does not consume.

5. Onboarding, nodes and inventory​

Source: internal/application/usecases/vendors.go, submissions.go and internal/domain/vendor/events.go.

Omitted: VendorSuspended and VendorReinstated have no consumer yet; node-performance binds VendorOnboarded to a handler that acknowledges it without effect (noEffect in its internal/adapters/inbound/kafka/handlers.go: only the inbox row is written); SubmissionProcessed goes out for every processed write (board 2).

Sticky inventory​

StickyKindSource in the code
Vendor system (network-fulfillment)External SystemThe Vendor API in internal/adapters/inbound/http; the fleet is one vendor, V-WS
order-sourcing, node-topology, offer-availability, shipping-and-tracking, node-performanceExternal Systeminternal/adapters/inbound/kafka/consumers.go (consumed), outbound/httpclient/clients.go (called) and the events' consumers on Integration
Network partner manager, expiry sweep timer, submission processorActorPOST /vendors; startBackground in cmd/api/background.go (the sweeper and the processor loops)
OnboardVendor, SuspendVendor, ReinstateVendor, IssueOnRelease, SubmitAcknowledgement, RequestLabel, SubmitShipmentConfirmation, ExpireUnacknowledged, CancelOnSourcingCancel, ProcessDueSubmissionsCommandMethods of usecases.Service
VendorAccount, PurchaseOrder, SubmissionAggregateinternal/domain/vendor, purchaseorder, submission
Published eventsDomain Eventinternal/adapters/outbound/kafka/encoder.go; see Events
Consumed eventsDomain Eventinternal/adapters/inbound/kafka/consumers.go, inbound_consumers.go
IssueOnRelease, CancelOnSourcingCancel, ExpireUnacknowledged, KnobsPolicyusecases.Service and usecases.Knobs
VendorNodeView, ListingView, purchase-order pollRead Modelnetwork.Node, network.Listing; GET /vendor/purchase-orders
H1: ackBy needs handlingTimeHotspot, resolvedNodeOperationalProfileDeclared is consumed and stored as handling_time_minutes on vendor_nodes; purchaseorder.ComputeAckBy uses it
H2: cancel after acknowledgement is refusedHotspot, open (one race)ErrCancelAfterAcknowledgement; CancelOnSourcingCancel logs and publishes nothing; an acceptance after order-sourcing cancelled a RELEASED assignment is only logged there
H3: label is synchronousHotspot, kept by designPOST /vendor/shipping-labels answers 200 with the labels; it calls shipping-and-tracking inline
H4: suspension had no route, event or effectHotspot, resolvedPOST /vendors/{vendorId}/suspensions and POST /vendors/{vendorId}/reinstatements, VendorSuspended and VendorReinstated, vendor.Account.EnsureActive before every write
H5: vendor never learns its nodeIdHotspot, resolvedGET /vendor/transactions/{transactionId} returns nodeId (result_node_id)
H6: caller identity without authHotspot, openvendorId is a body field and a required query parameter; ErrNodeNotOwnedByVendor is a consistency check, not authentication (in-cluster boundary)