Skip to main content

Introduction

outbound-shipping is the bounded context that gets every manifested package onto the right load before its cutoff, proves what left on which trailer, and tells the fleet that an order has actually shipped. It is a Supporting subdomain in the WMS area of the warehouse fleet (classification, ADR 0001). It is built on develop and not deployed: its Helm chart exists in charts/outbound-shipping/ but there is no warehouse-infra registration yet (see the runbook).

Source: docs/adr/0001 to 0006, internal/domain/*, internal/application/usecases/*, cmd/, apis/.

The business problem​

fulfillment-execution stops at PackageManifested: the package is packed and labelled. yard-management owns the trailer, the door work, the seal and the departure. Between them nothing owned staging, what is on a load, the bill of lading, or the fact that the goods left; an order's last state was Released. This context fills that gap with one owner for "what left on which truck".

What it owns​

AggregateIdentityWhat it isStates
OutboundLoadload_idThe packages planned to leave together for one (site, cpt, operating date, ship method); planned automatically from the first manifested package.PLANNED, LOADING, CLOSED, SHIP_CONFIRMED, CANCELLED
ShippingPackagepackage_idOne manifested package and where it is on its way to the truck (v1 ships packages, not pallets).EXPECTED, STAGED, LOADED, SHIPPED, SHORT_SHIPPED
BillOfLadingbol_numberThe shipping document of one confirmed load, issued exactly once per load, with carrier, trailer, seal, package count and total weight.ISSUED, VOIDED

It also keeps event-fed local copies of what it needs from neighbours (cutoff schedule, staging locations, dock appointments, door-work completions) and one read model, the load board behind the load-adherence report and the loads_at_risk MCP tool.

What it does not own​

  • The trailer, the door work, the seal and the physical departure: yard-management records them; this context only reacts.
  • The dock appointment and the door assignment: dock-scheduling.
  • The cutoff schedule (process-path-management) and the staging locations (facility-layout): consumed as local copies, never queried live.
  • The package before it is manifested: fulfillment-execution.
  • Transportation management (rating, tendering), pallets, load sequencing, master bill of lading and automated sortation or loading: out of scope (ADR 0001).
  • The shipment confirmation toward the retail network: network-fulfillment consumes ShipmentConfirmed; this service never talks to the network.

Main capabilities​

  1. Plan a load from the first manifest. PackageManifested resolves to a cutoff key through the local cutoff schedule; the first package of a key plans an OutboundLoad (LoadPlanned), later ones join it. One open load per key is a domain invariant backed by a partial unique index.
  2. Assign the door and start loading from facts. An outbound DockAppointmentBooked naming the load's cutoff assigns the door (LoadDoorAssigned); a TrailerDocked at that door attaches the trailer and starts loading (LoadingStarted). There is no REST route to start loading.
  3. Stage, load and unload by scan. REST commands move a package to STAGED at a Staging location of its site, to LOADED through its load's door, and back to STAGED.
  4. Close, reopen or cancel a load. A load closes only when every package is loaded or short-shipped with a reason; a supervisor can reopen a closed load or cancel a planned one that has no packages.
  5. Ship-confirm on the physical departure. TrailerDeparted from yard-management confirms a CLOSED load: ShipmentConfirmed (carrying the distinct orders), packages SHIPPED, and one BillOfLading issued with the yard's seal. A departure while the load is still LOADING never confirms: it flags every package not loaded with PackageMissedLoad (ADR 0002).
  6. Sweep missed loads. POST /missed-load-sweeps flags, exactly once per package, every staged or expected package whose load's cutoff has passed.
  7. Report adherence. GET /reports/load-adherence and the MCP tools loads_at_risk and missed_loads read the board and the package store.

Interfaces at a glance​

InterfaceSurface
REST13 routes plus /healthz and /readyz (cmd/api, apis/openapi.yaml)
Eventspublishes 13 types on warehouse.outbound-shipping.events and its analytics twin; consumes 9 types from 5 topics plus its own analytics stream (events)
MCPread-only, 2 tools, 1 resource, 1 prompt (cmd/mcp, tools)
A2Anone: there is no cmd/a2a

REST and MCP are unauthenticated, like every service of the fleet.

Where to go next​

You want toRead
Run or test itQuickstart, Testing
See how it is builtArchitecture, Entity relationship
Configure and operate itConfiguration, Runbook, Observability, Troubleshooting
Know what each trigger doesUse cases, Sequence diagrams
Understand the modelUbiquitous language, DDD artifacts
Integrate with itAPI overview, Events, Integration, MCP tools
Know why it is shaped this wayADR index