Skip to main content

Ubiquitous language

Use these exact names in code, API and conversation. Each term is a type, constant or field in internal/domain/**, a use case, or a migration column.

In the model​

TermMeaningWhere
Site (SiteID)One warehouse in the network. The identity is facility-layout's site_code; NIP keeps a string, not the site hierarchytransfer.SiteID, planning.SiteCapability.Site
PositionThe planner's point-in-time view of one SKU at one site: Available, CustomerReservations, ConfirmedInbound, CommittedOutbound, AsOf. Deliberately not an inventory ledgertransfer.Position
UsableAvailable − CustomerReservations − CommittedOutboundPosition.Usable()
PolicyVersioned guardrails for a SKU at a site: SafetyStock, TargetStock, UnitPrioritytransfer.Policy
DeficitTargetStock − (Usable + ConfirmedInbound), never negativePolicy.Deficit
LaneAn approved directed route between two sites with LeadTime, UnitHandlingCost, Enabledtransfer.Lane
ProposalAdvisory recommendation: origin, destination, SKU, quantity, policy version, position as-of, reasons, score breakdown. Reserves and moves nothingtransfer.Proposal
ReasonCodeDESTINATION_BELOW_TARGET, ORIGIN_ABOVE_SAFETY_STOCK, APPROVED_LANEtransfer.ReasonCode
ScoreBreakdownPriorityBenefit − HandlingPenalty − LeadTimePenalty; only a positive total is a valid proposaltransfer.ScoreBreakdown
PlannerDeterministic service turning positions, policies and lanes into proposalstransfer.Planner
SiteCapabilityA site's transfer capability from facility-layout: origin-enabled, destination-enabled, capability_revisionplanning.SiteCapability
SiteSkuDemandOne source order line's demand at a site: units, due_at, state ACTIVE or REMOVED, assignment versionplanning.SiteSkuDemand
PublishedCapacityPlanA warehouse-planning capacity plan mirrored locally: window [window_start, window_end), capacity_over_windowplanning.PublishedCapacityPlan
PlanningSnapshotThe coherent, fail-closed view simulation, approval and scheduled runs use. AsOf is the oldest watermark it usedplanning.PlanningSnapshot, BuildSnapshot
Participating siteA site with all three facts fresh within PLANNING_MAX_STALENESS. Others (missing or stale facts) are excluded, never zero-filled and never refuse the other sites (ADR-0018)planning.BuildSnapshot
Staleness budgetPLANNING_MAX_STALENESS (default 10m): the maximum age of any fact; an older fact excludes its sitecmd/network-inventory-planning/main.go
SimulationThe advisory per-site view: demand, capacity over window, headroom (negative = short)usecases.SimulateTransferOptions
InterWarehouseTransferThe saga aggregate: an operator-approved plan to move a quantity of one SKU from origin to destinationtransfer.InterWarehouseTransfer
TransferStateDRAFT, PROPOSED, APPROVED, ALLOCATING, ALLOCATED, RELEASING, PICKED, IN_TRANSIT, ARRIVED, RECEIVED, UNFULFILLABLE, CANCELLED; RECEIVED, UNFULFILLABLE and CANCELLED are terminaltransfer.TransferState
Transfer line (LineID)The v1 single line <transfer_id>:1; the correlation key with inventory-storageTransferID.LineID()
AuditEntryOne immutable transition: seq, from, to, event, reason, timetransfer.AuditEntry, transfer_audit
Idempotency keyThe approval's required Idempotency-Key, unique per transfer; a replay with the same body returns the originalinter_warehouse_transfer.idempotency_key
Approval expiry24h after approval; approving at or after it is proposal-expireddefaultApprovalExpiry
AllocationOne stock unit's part of the origin reservation (stock_unit_id, bin_id, quantity)transfer.Allocation
RejectionReasonORIGIN_SITE_UNKNOWN, INSUFFICIENT_USABLE, IDEMPOTENCY_CONFLICTtransfer.RejectionReason
WorkDemand (WorkDemandReleased)One leg released as warehouse work; demand_id is <transfer_id>:pick or :dispatchtransfer.DemandReleased
WorkKindTRANSFER_PICK, TRANSFER_DISPATCH, TRANSFER_ARRIVAL (WES's enum; NIP releases the first two)transfer.WorkKind
CPTCritical pull time of a released demand: release time + the leg's offsetTRANSFER_*_CPT_OFFSET
Work release configurationPath ids and CPT offsets of the two legs; deployment configuration, never request inputusecases.WorkReleaseConfig
Picked quantityWhat the origin pick actually picked; a short pick is recorded and the dispatch carries itInterWarehouseTransfer.PickedQuantity
StowAllocationA destination stow location from TransferStockStowedtransfer.StowAllocation
Stuck transferA non-terminal transfer whose last transition is older than its state's threshold. A reading, never a statetransfer.StuckCheck
StuckThresholdsALLOCATING=1h, RELEASING=1h, PICKED=24h, IN_TRANSIT=72h, 24h otherwise; NIP_STUCK_THRESHOLDS overridestransfer.DefaultStuckThresholds
Rebalance Policy catalogueNIP-owned, operator-managed Policy per site + SKU (safety stock, target stock, unit priority, version) that the scheduled pass plans from (ADR 0015)transfer.RebalancePolicy, rebalance_policies
Transfer Lane catalogueNIP-owned, operator-managed directed Lane (lead time, unit handling cost, enabled); used only when both ends are capabletransfer.TransferLane, transfer_lanes
Catalogue revisionA catalogue entry's optimistic-concurrency token: 1 on creation, +1 per change; the ETag/If-Match valueRebalancePolicy.Revision, TransferLane.Revision
RebalanceRunOne scheduled, observe-only planning pass: watermark, counts, COMPLETED or FAILED with its fail-closed reasontransfer.RebalanceRun, rebalance_runs
Saga-health occurrenceAn analytics event about the saga, not a contract event: TransferStateAdvanced, TransferStuckDetected, RebalanceRunCompletedwarehouse.network-inventory-planning.analytics
OutboxThe outbox_events table every published event is written to, in the same transaction as its causepostgres.OutboxWriter
FreshnessHow far the analytics projection is behind: as_of, lag_secondsreport.Freshness

Words used with care​

  • A proposal is advice; a transfer exists only after approval.
  • Allocated is inventory-storage's reservation of origin stock; it is not picked, shipped or received.
  • Stuck is a reading; nothing ever moves a transfer because it is stuck.
  • Fail-closed means refuse (503/422, a FAILED run), never answer with an empty or zero-filled result.

Not implemented​

Terms from the design plan that have no code: NetworkNode, SKUPlacementPolicy, DemandForecast, a projected NetworkInventoryPosition read model, lane capacity and dispatch calendars, carbon cost, auto-approval.