Network Inventory Planning
network-inventory-planning (NIP) is the bounded context that decides
whether stock should move between warehouses and then carries an approved
inter-warehouse transfer from the origin reservation to the destination stow.
It recommends and coordinates; it never becomes the inventory ledger and never
moves physical stock itself
(ADR 0001).
inventory-storage stays authoritative for stock and reservations, and the
WES contexts stay authoritative for executable work.
| Fact | Value | Source |
|---|---|---|
| Tier | WES (CloudEvents type segment wes) | internal/adapters/kafka/cloudevents/cloudevents.go (Subdomain = "wes") |
| Subdomain class | Core | Subdomain classification |
Event type prefix | com.warehouse.wes.network-inventory-planning. | cloudevents.Type() |
CloudEvents source | /warehouse/network-inventory-planning | cloudevents.Source |
| Own Kafka topics | warehouse.network-inventory-planning.events (integration) and warehouse.network-inventory-planning.analytics (saga health) | internal/adapters/outbound/kafka/publisher.go, analytics_publisher.go |
| Binaries | network-inventory-planning (API, consumers, outbox relay, tickers), mcp, nip-projector, nip-reports | cmd/*/main.go |
| Edge | Kong :8000 under /api/network-inventory-planning; the console remote nip_mfe is served by Nginx :80 | ADR 0010; the route itself is supplied by warehouse-infra through the chart's disabled-by-default gatewayApi / ingress values |
| Authentication | None. REST and MCP are unauthenticated fleet-wide; access control is the cluster boundary | internal/architecture/fitness_test.go (TestNoAuthMiddlewareReintroduced) |
What it owns
- Advisory transfer proposals.
POST /v1/transfer-proposal-runsruns the deterministictransfer.Plannerover an explicit, coherent snapshot (positions, policies, lanes) supplied by the caller. A proposal keeps the origin's safety stock, never exceeds the destination's deficit, only uses an enabled directed lane and carries reason codes plus a score breakdown. - Three local read models fed by Kafka:
site_capability(facility-layout'sSiteCapabilityChanged),site_sku_demand(order-management'sSiteSkuDemandChanged) andpublished_capacity_plan(warehouse-planning'sCapacityPlanPublished). - The fail-closed planning snapshot (
planning.BuildSnapshot): a site participates only with all three facts fresh withinPLANNING_MAX_STALENESS; stale or empty inputs refuse instead of zero-filling. It backs the advisory simulation (GET /v1/transfer-simulations), approval validation and the scheduled rebalance pass. - The
InterWarehouseTransfersaga (12 states,DRAFTtoRECEIVED), started only by an operator'sPOST /v1/transfer-approvalswith anIdempotency-Key. It emitsTransferAllocationRequestedto inventory-storage, releases pick and dispatchWorkDemandReleasedcommands to wes-work-planning, and follows fulfillment-execution's and inventory-storage's facts to the destination. Every event goes through a transactional outbox. - Saga-health observation: a stuck-transfer check and an observe-only
scheduled rebalance publish analytics occurrences;
nip-projectorfolds them into a separate analytical database thatnip-reportsserves read-only. - A read-only MCP server with four tools for AI clients (warehouse-ops-agent uses all four).
What it does not own
- Stock quantities, reservations and stow locations (inventory-storage).
- Work units, waves and task execution (wes-work-planning, fulfillment-execution).
- Site capabilities, customer demand and capacity plans (facility-layout, order-management, warehouse-planning): NIP keeps local copies only.
- Forecasting, route optimisation and auto-approval: not built.
Read next
| If you want to | Read |
|---|---|
| See the processes, ports and data stores | Architecture |
| Run it on your machine | Quickstart |
| Configure a binary | Configuration |
| Deploy and operate it | Runbook |
| Watch it | Observability |
| Debug a symptom | Troubleshooting |
| Run or extend the tests | Testing |
| Know who it talks to | Integration |
| Call it from an AI client | MCP tools |
| Understand the model | Use cases, Domain events, Ubiquitous language |
| Read the decisions | ADR index |
| Call the REST API | API reference |
Disclaimer
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.