Stock
Stock Type
Represents inventory stock levels for items in repositories. Stock records track quantities and pending movements, providing both current and projected inventory levels.
Fields
id
ID!
Unique identifier of the stock record
tenantID
UUID!
Tenant identifier
createdAt
Time!
Creation timestamp
createdBy
UUID!
User identifier who created the stock record
updatedAt
Time
Last update timestamp
updatedBy
UUID
User identifier who last updated the stock record
deletedAt
Time
Deletion timestamp
deletedBy
UUID
User identifier who deleted the stock record
itemID
UUID!
ID of the inventory item
repositoryID
UUID!
ID of the repository where stock is located
quantity
Int!
Total quantity including child repositories
ownQuantity
Int!
Quantity in this repository only (excluding children)
incomingStock
Int!
Pending incoming movements (including children)
ownIncomingStock
Int!
Pending incoming movements to this repository only
outgoingStock
Int!
Pending outgoing movements (including children)
ownOutgoingStock
Int!
Pending outgoing movements from this repository only
item
InventoryItem
The inventory item this stock belongs to
repository
Repository
The repository this stock is in
Stock Calculation
Available Stock =
quantity-outgoingStockProjected Stock =
quantity+incomingStock-outgoingStock
The distinction between "own" and total quantities is important for hierarchical repositories:
quantityincludes stock in all child repositoriesownQuantityis only the stock directly in this repository
Usage Example
Notes
Stock records are automatically maintained by the system through movements
Virtual repositories may have stock records but don't enforce validation
Use
ownQuantitywhen you need stock at a specific location onlyUse
quantitywhen you need total available stock including child locations
Last updated
Was this helpful?
