InventoryStock
The InventoryStock entity, mapped to the inventory_stock table.
| Table | inventory_stock |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 2 |
| Relationships | 2 |
| Source | backend/src/main/java/com/motorph/payroll/model/InventoryStock.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
stockId | Integer | stock_id | — | primary key, generated |
quantity | Integer | quantity | — | — |
Plus tenant_id, inherited from TenantOwned. Hibernate stamps it on insert and adds where tenant_id = ? to every query, so it is never written or read by application code.
Relationships
| Field | Kind | Target | Join column | Required |
|---|---|---|---|---|
item | @ManyToOne | InventoryItem | item_id | Yes |
location | @ManyToOne | WarehouseLocation | location_id | Yes |
Neighbourhood
Repository
InventoryStockRepository
Declared over InventoryStock with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/InventoryStockRepository.java
| Method | Returns | Notes |
|---|---|---|
findAllByItem_ItemId(Integer itemId) | List<InventoryStock> | derived |
findAllByLocation_LocationId(Integer locationId) | List<InventoryStock> | derived |
findByItem_ItemIdAndLocation_LocationId(Integer itemId, Integer locationId) | Optional<InventoryStock> | derived |
sumQuantityByItemId(Integer itemId) | Integer | explicit @Query |
findLowStock() | List<InventoryStock> | explicit @Query |
findAllByLocation_Warehouse_WarehouseId(Integer warehouseId) | List<InventoryStock> | derived |
Reached by
These controllers hold — directly or through a service they depend on — a repository over InventoryStock.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| InventoryController | /api/inventory | 38 | Inventory & Portal |
| WarehouseTransferController | /api/inventory/transfers | 2 | Inventory & Portal |
Generated page
This page is rebuilt from the source on every docs build by docs-site/scripts/gen-code-wiki.mjs. Editing it has no effect — change the code, or, if what you want to say is prose, write it in docs/.