InventoryItem
object type
An inventory item: ONE per (Variant x LogicalFacility), carrying the CACHED bucket balances + the weighted-moving-average cost. Parent = the Variant; the other junction leg is the IMMUTABLE logicalFacilityId. The junction (variant x LF) is unique (a live duplicate is CONFLICT/IDENTITY_TAKEN naming the holder). styleType is BIRTH-STAMPED from the spine (immutable upstream): simple/kit IIs are STOCKED; service/bundle IIs are STOCKLESS price-carriers refusing quantity movements. Buckets are SIGNED decimal strings moved ONLY by the movement ops (receiveStock/adjustStock/reclassStock: one movement = ONE transaction; overcommit is allowed + ALWAYS evented, IV-i); available = on_hand − reserved, ALWAYS derived, never stored. Doom requires EVERY bucket exactly zero (CONFLICT/REFERENCED naming the non-zero buckets); deactivate is FREE and reversible. onOrderQty is a SIXTH field, NOT a bucket: the open quantity of the issued purchase orders for this junction, maintained by the purchase-order walks + the receipt post — never by movements, never inside available; a pre-walk row reads 0; the audit/repair pair (inventoryOnOrderAudit / repairInventoryOnOrder) stamps the derived truth over drift.
Fields
| Field | Type | Notes |
|---|---|---|
id | ID ID! | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
sysId | String String! | The group-scoped human-facing system id (IV-…). |
type | String String! | The kind of record — always InventoryItem here. |
caption | String String! | The record’s display name — what people see it called. |
status | String String! | The FSM state: active | inactive | doomed. |
parentId | ID ID! | The parent Variant; for an InventoryItem parentId!== rootId. |
rootId | ID ID! | The org-group family root. |
createdAt | String String! | When the record was created, as a UTC timestamp. |
updatedAt | String String! | When the record last changed, as a UTC timestamp. |
revisionNum | Int Int! | How many times this record has been edited; the first save is 0. |
revision | ID ID! | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
refCaptions | RefCaption [RefCaption!]! | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
logicalFacilityId | ID ID! | The LogicalFacility leg of the junction — set at creation, IMMUTABLE thereafter. |
styleType | String String! | The BIRTH-STAMPED spine styleType: simple | service | kit | bundle; service/bundle IIs are stockless price-carriers. |
controlClass | String String! | The control class (canned: non-controlled | lot-controlled | serially-controlled — server-validated, the DC-d shape). Mutable — an ordinary edit. |
onHandQty | String String! | The CACHED on_hand balance — a SIGNED decimal string; moves ONLY via movements. |
reservedQty | String String! | The CACHED reserved claim overlay. |
inTransitQty | String String! | The CACHED in_transit balance (the transfer saga — zero until that slice). |
damagedQty | String String! | The CACHED damaged balance. |
heldQty | String String! | The CACHED held balance (reason-coded via the movement entries). |
onOrderQty | String String! | On order — the issued purchase orders’ open quantity for this item: maintained by the purchase-order walks (+ at issue/approve, − at cancel, − the open remainder at close_short) and the receipt post (− the arriving quantity); NOT part of available; every decrement clamps at 0. A pre-walk row reads 0; the audit/repair pair (inventoryOnOrderAudit / repairInventoryOnOrder) stamps the derived truth over any drift. |
availableQty | String String! | DERIVED, never stored: on_hand − reserved, computed at read time (exact decimal-string arithmetic). |
wmaCost | MoneyEntry | The weighted-moving-average unit cost. Absent until the first costed receive. |