Skip to main content

InventoryItem

The InventoryItem entity, mapped to the inventory_item table.

Tableinventory_item
Tenant-scopedYes — extends TenantOwned
Columns16
Relationships3
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—
classificationStringclassification—Inventory classification for valuation and the BIR inventory list (V152).
reorderQtyIntegerreorder_qtyYesHow many to order when stock falls below the reorder point.
safetyStockIntegersafety_stock—The floor kept for emergencies, in every warehouse without its own level (V160).
averageCostBigDecimalaverage_cost—Moving weighted average cost and the item's total carrying value across all locations.
carryingValueBigDecimalcarrying_value——
statusStringstatus——
trackingTypeStringtracking_type——
isSellableBooleanis_sellable—Which document line pickers may offer this item.
isPurchasableBooleanis_purchasable——

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—
defaultTaxCode@ManyToOneTaxCodedefault_tax_code_id—
preferredSupplier@ManyToOneSupplierpreferred_supplier_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​

12 of 13 associations shown; the tables above are complete.

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
lockById(@org.springframework.data.repository.query.Param("id") Integer id)Optional<InventoryItem>explicit @Query
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/orders7Inventory & 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/.