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.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

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.

  1. Pivotal eventPurchaseOrderIssued
  2. Pivotal eventPurchaseOrderAccepted
  3. Pivotal eventVendorShipmentConfirmed
  4. Pivotal eventInboundReceiptSubmitted

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
  1. 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 manager
    CommandOnboardVendorPOST /vendors
    AggregateAccount
    EventVendorOnboarded

    Source: application/usecases/vendors.go · domain/vendor/vendor.go

  2. Suspend a vendor

    A partner manager suspends a vendor. While suspended, every write the vendor sends is refused.

    ActorNetwork partner manager
    CommandSuspendVendorPOST /vendors/{vendorId}/suspensions
    AggregateAccount
    EventVendorSuspended

    Source: application/usecases/vendors.go · domain/vendor/vendor.go

  3. Reinstate a vendor

    A partner manager lifts the suspension and the vendor can write again.

    ActorNetwork partner manager
    CommandReinstateVendorPOST /vendors/{vendorId}/reinstatements
    AggregateAccount
    EventVendorReinstated

    Source: application/usecases/vendors.go · domain/vendor/vendor.go

  4. 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
    EventFulfillmentReleasedToNode
    PolicyWhenever a group is released to a vendor-run node, issue one purchase order for it
    Read modelVendor nodes
    CommandIssueOnReleasestarted by the policy
    AggregatePurchaseOrder
    EventPurchaseOrderIssued
    Systemnode-performance
    PolicyTracks the order for the node's scorecard

    Source: application/usecases/orders.go · domain/purchaseorder/purchaseorder.go · adapters/inbound/kafka/consumers.go

  5. 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 system
    Read modelPurchase orders
    CommandSubmitAcknowledgementPOST /vendor/acknowledgements
    AggregatePurchaseOrder

    Source: application/usecases/orders.go · domain/purchaseorder/commands_ack.go

  6. 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 processor
    PolicyWhenever a queued vendor write is due, run it and apply its outcome to the purchase order
    CommandProcessSubmissionstarted by the clock
    AggregateSubmission
    EventSubmissionProcessed
    EventPurchaseOrderAccepted
    EventPurchaseOrderRejected
    EventVendorShipmentConfirmed
    Systemorder-sourcing
    PolicyLocks the group on acceptance, tries another node on rejection, marks it shipped
    Systemshipping-and-tracking
    PolicyRecords a shipment-confirmed scan for each tracking number
    Systemnode-performance
    PolicyCounts the answer and the shipment for the node's scorecard

    Source: application/usecases/submissions.go · domain/submission/submission.go · domain/purchaseorder/commands_shipment.go

  7. 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 sweep
    PolicyEvery sweep, an issued order past its acknowledge-by time expires
    CommandExpireUnacknowledgedstarted by the clock
    AggregatePurchaseOrder
    EventPurchaseOrderExpired
    Systemorder-sourcing
    PolicyExcludes the node and searches again
    Systemnode-performance
    PolicyCounts the missed deadline for the node's scorecard

    Source: application/usecases/orders.go · domain/purchaseorder/purchaseorder.go

  8. 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 answer
    CommandCancelOnSourcingCancelstarted by the policy
    AggregatePurchaseOrder
    EventPurchaseOrderCancelledanalytics stream only

    Source: application/usecases/orders.go · domain/purchaseorder/purchaseorder.go

  9. 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
    EventFulfillmentReleaseWithdrawn
    PolicyWhenever a release is withdrawn, cancel the purchase order of that release if it is still waiting
    CommandCancelOnReleaseWithdrawnstarted by the policy
    AggregatePurchaseOrder
    EventPurchaseOrderCancelledanalytics stream only

    Source: application/usecases/orders_withdrawn.go · 0013-cancel-the-purchase-order-when-a-release-is-withdrawn.md

  10. 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 system
    CommandRequestLabelPOST /vendor/shipping-labels
    AggregatePurchaseOrder
    Systemshipping-and-tracking
    PolicyIs called right away to issue one label per package

    Source: application/usecases/orders.go · domain/purchaseorder/commands_labels.go

  11. 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 system
    CommandSubmitShipmentConfirmationPOST /vendor/shipment-confirmations
    AggregatePurchaseOrder

    Source: application/usecases/orders.go · domain/purchaseorder/commands_shipment.go

  12. 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 system
    CommandRegisterVendorNodePOST /vendor/nodes
    AggregateSubmission

    Source: application/usecases/submissions.go · domain/submission/submission.go

  13. 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 system
    Read modelInbound shipments copy
    CommandSubmitInboundReceiptPOST /vendor/inbound-receipts
    AggregateReceipt
    EventInboundReceiptSubmitted
    Systemseller-inbound
    PolicyRecords the findings and closes the inbound shipment
    Systemnode-performance
    PolicyUses the carton findings for the node's inbound accuracy score

    Source: application/usecases/inbound.go · domain/inbound/receipt.go · 0005-inbound-shipments-receipts-and-catalog-packaging.md

  14. 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
    EventInboundShipmentShipped
    PolicyWhenever an inbound shipment is labelled, shipped or received, update the local shipments copy
    CommandOnInboundShipmentShippedstarted by the policy
    Read model · kept up to dateInbound shipments copy

    Source: application/usecases/inbound.go · adapters/inbound/kafka/inbound_consumers.go

  15. 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 copy
    Read modelVendor nodes
    CommandOnReturnAuthorizedstarted by the policy
    Read model · kept up to dateReturn advices copy

    Source: application/usecases/returns.go · 0014-return-advices-and-outcomes.md

  16. 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 system
    Read modelReturn advices copy
    CommandSubmitReturnOutcomePOST /vendor/return-outcomes
    AggregateAdvice
    EventVendorReturnOutcomeSubmitted
    Systemcustomer-returns
    PolicyCompletes the return so good units are restocked; items it never authorized are recorded, not restocked

    Source: application/usecases/returns.go · domain/returns/returns.go · 0014-return-advices-and-outcomes.md

  17. 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 list
    CommandOnNodeStatusstarted by the policy
    Read model · kept up to dateVendor nodes

    Source: application/usecases/queries.go · adapters/inbound/kafka/consumers.go

  18. 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 node
    CommandOnListingCreatedstarted by the policy
    Read model · kept up to dateListings

    Source: 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.

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.