network-fulfillment
network-fulfillment is the bounded context that lets the warehouse fleet take
orders from an external retail fulfillment network and answer them. It is the
Anti-Corruption Layer between that network and everything else in
warehouse-systems: the network's vocabulary (purchase orders, product ids,
acknowledgement codes) stops here, and the fleet only ever sees SKUs,
quantities, a site and a deadline.
- Subdomain: Supporting (why).
- Tier:
wes. Every event it publishes is typedcom.warehouse.wes.network-fulfillment.networkorder.<Event>. - Counterpart: the fleet's own
retail-networkservice plays the network (ADR 0009).NETWORK_MODEpicks the gateway: the in-process stub (the default) or, withlive, the demand loop against the network's Vendor API (ADR 0026; the supply loop is ADR 0027, not built). - Status: implemented; the stub is the default everywhere and
liveis opt-in. A study project, not a production system (see the repository README).
What it owns
NetworkOrder: one unit of network demand and the single answer given to it.NEW -> SUBMITTED -> ACKNOWLEDGED -> CONFIRMED, orREJECTEDfromNEWorSUBMITTED. Acknowledged in full or rejected in full, within 24 h of receipt.- The 24 h acknowledgement clock: the fleet's only external SLA. A sweep
reports overdue orders and a separate job rejects them. A third pass is the
backstop for the
order-managementhold each order raises: it cancels a hold nobody decided once the window plus a grace has passed (ADR 0024). CapabilityOffer(always on): the quantity per SKU and site this context would advertise,min(physicalAvailable, throughputFeasible), so the network is never offered more than the building can move before the next cutoff. Computed and stored; in live modeFeedInventorysends it to the network as a per-site inventory feed (ADR 0027 part 2).- The product dictionary: network product id to SKU, loaded from
PRODUCT_TRANSLATION_FILE. An order with one unknown product is rejected.
It does not own the promise math: whether a deadline is feasible is asked
of order-management through a held order (ADR 0001 §7).
Main capabilities
| Capability | How | Page |
|---|---|---|
| Receive demand | poll the network every POLL_INTERVAL, translate, raise a held order in order-management, answer | use cases |
| Settle answers | reconcile each SUBMITTED order with the network's transaction status, then release or cancel the hold | use cases |
| Guard the SLA | report and reject orders still unanswered after 24 h | use cases |
| Free orphaned holds | cancel the order-management hold of an order nobody decided, after acknowledgeBy + ORPHAN_HOLD_GRACE | use cases, runbook |
| Confirm shipment | a ShipmentConfirmed event from outbound-shipping (primary), or POST /network-orders/{networkRef}/shipment-confirmation (operator fallback) | use cases |
| Advertise capability | recompute offers from inventory-storage stock and path capacity | use cases |
| Publish facts | seven CloudEvents types on warehouse.network-fulfillment.events | integration |
| Report | acknowledgement and translation report from an analytics data product | runbook |
| Answer agents | read-only MCP tools | MCP tools |
Binaries
cmd/netfulfil (REST API and every background job), cmd/mcp (MCP server),
cmd/netfulfil-projector (analytics writer) and cmd/netfulfil-reports
(analytics reader), plus the web/ remote for warehouse-console. See
architecture.
Documentation map
Overview
- Architecture: binaries, hexagonal layout, data stores, diagram
- Quickstart: build, test, run locally, first calls
Operations
- Configuration: every env var per binary
- Runbook: deployment, probes, migrations, Kafka, outbox, scaling, procedures, reports API
- Observability: metrics, traces, logs, alerts
- Troubleshooting: symptom, cause, check, fix
Development
Integration and interfaces
- Integration: every upstream and downstream
- MCP tools
- REST contract:
apis/openapi.yaml; event catalogue:apis/asyncapi.yaml
Domain
- Use cases
- Subdomain classification
- DDD artifact pack: canvases, context map, EventStorming, diagrams, glossary, domain events
Decisions
This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.