Skip to main content

InventoryItem

The InventoryItem entity, mapped to the inventory_item table.

Tableinventory_item
Tenant-scopedYes — extends TenantOwned
Columns9
Relationships1
Sourcebackend/src/main/java/com/motorph/payroll/model/InventoryItem.java

Columns​

FieldTypeColumnNullNotes
itemIdIntegeritem_id—primary key, generated
skuStringsku—unique
nameStringname——
descriptionStringdescriptionYes—
unitOfMeasureStringunit_of_measure——
reorderPointIntegerreorder_point——
unitCostBigDecimalunit_costYes—
statusStringstatus——
trackingTypeStringtracking_type——

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
category@ManyToOneItemCategorycategory_id—

Referenced by​

EntityFieldKind
CustomerOrderItemitem@ManyToOne
InventoryLotitem@ManyToOne
InventoryStockitem@ManyToOne
ItemPriceitem@ManyToOne
ItemPriceHistoryitem@ManyToOne
ItemSerialitem@ManyToOne
PurchaseReceivingItemitem@ManyToOne
StockTransactionitem@ManyToOne
StoreInventoryitem@ManyToOne
WarehouseTransferitem@ManyToOne

Neighbourhood​

Repository​

InventoryItemRepository​

Declared over InventoryItem with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/InventoryItemRepository.java

MethodReturnsNotes
existsBySkuIgnoreCase(String sku)booleanderived
existsBySkuIgnoreCaseAndItemIdNot(String sku, Integer itemId)booleanderived
findBySkuIgnoreCase(String sku)Optional<InventoryItem>derived
findAllByCategory_CategoryId(Integer categoryId)List<InventoryItem>derived
searchByKeyword(String keyword)List<InventoryItem>explicit @Query

Reached by​

These controllers hold — directly or through a service they depend on — a repository over InventoryItem.

ControllerBase pathEndpointsModule
BarcodeController/api/inventory1Inventory & Portal
InventoryController/api/inventory38Inventory & Portal
InventoryReportController/api/inventory/reports3Inventory & Portal
ItemPriceController—6Inventory & Portal
PortalOrderController/api/portal/orders4Inventory & Portal
SerialLotController/api/inventory5Inventory & Portal
StoreController/api/inventory/stores7Inventory & 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/.