Skip to main content

InventoryStock

The InventoryStock entity, mapped to the inventory_stock table.

Tableinventory_stock
Tenant-scopedYes — extends TenantOwned
Columns2
Relationships2
Sourcebackend/src/main/java/com/motorph/payroll/model/InventoryStock.java

Columns​

FieldTypeColumnNullNotes
stockIdIntegerstock_id—primary key, generated
quantityIntegerquantity——

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​

FieldKindTargetJoin columnRequired
item@ManyToOneInventoryItemitem_idYes
location@ManyToOneWarehouseLocationlocation_idYes

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

MethodReturnsNotes
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)Integerexplicit @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.

ControllerBase pathEndpointsModule
InventoryController/api/inventory38Inventory & Portal
WarehouseTransferController/api/inventory/transfers2Inventory & 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/.