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.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
10
commands
15
policies
13
read models
6
hot spots
5

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
  1. 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 manager
    CommandOnboardSellerPOST /sellers
    AggregateAccount
    EventSellerOnboardedanalytics stream only

    Source: application/usecases/sellers.go · domain/seller/seller.go

  2. 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.

    ActorSeller
    Read modelNodes that can receive
    CommandCreateInboundPlanPOST /inbound-plans
    AggregatePlan

    Source: application/usecases/plans.go · domain/inboundplan/plan.go

  3. 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.

    ActorSeller
    Read modelNodes that can receive
    CommandConfirmInboundPlanPOST /inbound-plans/{planId}/confirmations
    AggregatePlan
    EventInboundPlanConfirmedanalytics stream only

    Source: application/usecases/plans.go · domain/inboundplan/plan.go

  4. 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.

    ActorSeller
    Read modelPackaging levels
    Read modelNodes that can receive
    CommandAddCartonPOST /inbound-shipments/{shipmentId}/cartons
    AggregateShipment

    Source: application/usecases/shipments.go · domain/inboundshipment/carton_add.go · domain/inboundshipment/shipment.go

  5. 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.

    ActorSeller
    CommandLabelShipmentPOST /inbound-shipments/{shipmentId}/labels
    AggregateShipment
    EventInboundShipmentLabelled
    Systemvendor-connectivity
    PolicyKeeps the carton list in the inbound shipment view it serves to vendors

    Source: application/usecases/shipments.go · domain/inboundshipment/shipment.go · domain/inboundshipment/events.go

  6. 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.

    ActorSeller
    CommandShipInboundShipmentPOST /inbound-shipments/{shipmentId}/dispatches
    AggregateShipment
    EventInboundShipmentShipped
    Systemvendor-connectivity
    PolicyMarks the shipment as shipped in the view it serves to vendors
    Systemnode-performance
    PolicyKeeps the shipped time, to measure how long the delivery takes

    Source: application/usecases/shipments.go · domain/inboundshipment/shipment.go · domain/inboundshipment/events.go

  7. 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
    EventInboundReceiptSubmitted
    PolicyWhenever a vendor submits a receipt, apply it carton by carton and record every difference
    CommandApplyInboundReceiptstarted by the policy
    AggregateShipment
    EventInboundDiscrepancyRecordedanalytics stream only
    EventSellerComplianceViolationRecordedanalytics stream only
    Read model · kept up to dateSeller scorecard facts

    Source: application/usecases/consumers.go · adapters/inbound/kafka/consumers.go · domain/inboundshipment/receipt.go · domain/scorecard/facts.go

  8. 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
    EventInboundReceiptSubmitted
    PolicyWhenever the last carton gets an answer, close the shipment and announce what arrived
    Read modelPackaging levels
    CommandApplyInboundReceiptstarted by the policy
    AggregateShipment
    EventInboundShipmentReceived
    Systemoffer-availability
    PolicyCreates the seller's own listings from the stock that arrived
    Systemvendor-connectivity
    PolicyMarks the shipment as received in the view it serves to vendors

    Source: application/usecases/consumers.go · domain/inboundshipment/received.go · domain/inboundshipment/receipt.go · 0014-received-stock-is-published-per-item.md

  9. 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 manager
    CommandSuspendSellerPOST /sellers/{sellerId}/suspensions
    AggregateAccount
    EventSellerSuspended
    Systemoffer-availability
    PolicySuppresses the seller's listings

    Source: application/usecases/sellers.go · domain/seller/seller.go · 0013-seller-status-is-an-integration-fact.md

  10. 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 manager
    CommandReinstateSellerPOST /sellers/{sellerId}/reinstatements
    AggregateAccount
    EventSellerReinstated
    Systemoffer-availability
    PolicyRestores the seller's listings

    Source: application/usecases/sellers.go · domain/seller/seller.go · 0013-seller-status-is-an-integration-fact.md

  11. 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.

    ActorSeller
    Read modelRegional demand
    Read modelNode availability
    Read modelFulfilment centres
    CommandComputePlacementPlanPOST /placement-plans
    AggregatePlan
    EventPlacementPlanSuggested

    Source: application/usecases/placement.go · domain/placementplan/plan.go · 0012-the-placement-advisory.md

  12. 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.

    ActorSeller
    CommandAcceptPlacementPlanPOST /placement-plans/{planId}/acceptances
    AggregatePlan

    Source: application/usecases/placement.go · domain/placementplan/plan.go · 0012-the-placement-advisory.md

  13. 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 row
    CommandApplyNodeRegisteredstarted by the policy
    Read model · kept up to dateNodes that can receive

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

  14. 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
    EventCatalogItemPackagingDeclared
    PolicyWhenever a pack level is declared or retired, update the packaging levels
    CommandApplyPackagingDeclaredstarted by the policy
    Read model · kept up to datePackaging levels

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

  15. 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
    EventListingAvailabilityChanged
    PolicyWhenever a listing's availability changes, keep the latest figure per item and node
    CommandApplyListingAvailabilityChangedstarted by the policy
    Read model · kept up to dateNode availability

    Source: application/usecases/consumers.go · adapters/inbound/kafka/consumers.go · domain/network/demand.go

  16. 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
    EventFulfillmentReleasedToNode
    PolicyWhenever an order is released to a node, keep its lines as demand for that region
    CommandApplyFulfillmentReleasedstarted by the policy
    Read model · kept up to dateRegional demand

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

    Source: adr/0005-seller-compliance-scorecard.md

  • 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.

    Source: adr/0012-the-placement-advisory.md

Opportunities

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.