Skip to main content

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.

FactValueSource
TierWES (CloudEvents type segment wes)internal/adapters/kafka/cloudevents/cloudevents.go (Subdomain = "wes")
Subdomain classCoreSubdomain classification
Event type prefixcom.warehouse.wes.network-inventory-planning.cloudevents.Type()
CloudEvents source/warehouse/network-inventory-planningcloudevents.Source
Own Kafka topicswarehouse.network-inventory-planning.events (integration) and warehouse.network-inventory-planning.analytics (saga health)internal/adapters/outbound/kafka/publisher.go, analytics_publisher.go
Binariesnetwork-inventory-planning (API, consumers, outbox relay, tickers), mcp, nip-projector, nip-reportscmd/*/main.go
EdgeKong :8000 under /api/network-inventory-planning; the console remote nip_mfe is served by Nginx :80ADR 0010; the route itself is supplied by warehouse-infra through the chart's disabled-by-default gatewayApi / ingress values
AuthenticationNone. REST and MCP are unauthenticated fleet-wide; access control is the cluster boundaryinternal/architecture/fitness_test.go (TestNoAuthMiddlewareReintroduced)

What it owns​

  • Advisory transfer proposals. POST /v1/transfer-proposal-runs runs the deterministic transfer.Planner over 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's SiteCapabilityChanged), site_sku_demand (order-management's SiteSkuDemandChanged) and published_capacity_plan (warehouse-planning's CapacityPlanPublished).
  • The fail-closed planning snapshot (planning.BuildSnapshot): a site participates only with all three facts fresh within PLANNING_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 InterWarehouseTransfer saga (12 states, DRAFT to RECEIVED), started only by an operator's POST /v1/transfer-approvals with an Idempotency-Key. It emits TransferAllocationRequested to inventory-storage, releases pick and dispatch WorkDemandReleased commands 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-projector folds them into a separate analytical database that nip-reports serves 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.
If you want toRead
See the processes, ports and data storesArchitecture
Run it on your machineQuickstart
Configure a binaryConfiguration
Deploy and operate itRunbook
Watch itObservability
Debug a symptomTroubleshooting
Run or extend the testsTesting
Know who it talks toIntegration
Call it from an AI clientMCP tools
Understand the modelUse cases, Domain events, Ubiquitous language
Read the decisionsADR index
Call the REST APIAPI 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.