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
| Aggregate | Identity | What it is | States |
|---|---|---|---|
OutboundLoad | load_id | The 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 |
ShippingPackage | package_id | One manifested package and where it is on its way to the truck (v1 ships packages, not pallets). | EXPECTED, STAGED, LOADED, SHIPPED, SHORT_SHIPPED |
BillOfLading | bol_number | The 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
- Plan a load from the first manifest.
PackageManifestedresolves to a cutoff key through the local cutoff schedule; the first package of a key plans anOutboundLoad(LoadPlanned), later ones join it. One open load per key is a domain invariant backed by a partial unique index. - Assign the door and start loading from facts. An outbound
DockAppointmentBookednaming the load's cutoff assigns the door (LoadDoorAssigned); aTrailerDockedat that door attaches the trailer and starts loading (LoadingStarted). There is no REST route to start loading. - Stage, load and unload by scan. REST commands move a package to
STAGEDat a Staging location of its site, toLOADEDthrough its load's door, and back toSTAGED. - 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.
- Ship-confirm on the physical departure.
TrailerDepartedfrom yard-management confirms aCLOSEDload:ShipmentConfirmed(carrying the distinct orders), packagesSHIPPED, and oneBillOfLadingissued with the yard's seal. A departure while the load is stillLOADINGnever confirms: it flags every package not loaded withPackageMissedLoad(ADR 0002). - Sweep missed loads.
POST /missed-load-sweepsflags, exactly once per package, every staged or expected package whose load's cutoff has passed. - Report adherence.
GET /reports/load-adherenceand the MCP toolsloads_at_riskandmissed_loadsread the board and the package store.
Interfaces at a glance
| Interface | Surface |
|---|---|
| REST | 13 routes plus /healthz and /readyz (cmd/api, apis/openapi.yaml) |
| Events | publishes 13 types on warehouse.outbound-shipping.events and its analytics twin; consumes 9 types from 5 topics plus its own analytics stream (events) |
| MCP | read-only, 2 tools, 1 resource, 1 prompt (cmd/mcp, tools) |
| A2A | none: there is no cmd/a2a |
REST and MCP are unauthenticated, like every service of the fleet.
Where to go next
| You want to | Read |
|---|---|
| Run or test it | Quickstart, Testing |
| See how it is built | Architecture, Entity relationship |
| Configure and operate it | Configuration, Runbook, Observability, Troubleshooting |
| Know what each trigger does | Use cases, Sequence diagrams |
| Understand the model | Ubiquitous language, DDD artifacts |
| Integrate with it | API overview, Events, Integration, MCP tools |
| Know why it is shaped this way | ADR index |