Skip to main content

ItemPriceHistory

The ItemPriceHistory entity, mapped to the item_price_history table.

Tableitem_price_history
Tenant-scopedYes — extends TenantOwned
Columns5
Relationships3
Sourcebackend/src/main/java/com/motorph/payroll/model/ItemPriceHistory.java

Columns​

FieldTypeColumnNullNotes
historyIdIntegerhistory_id—primary key, generated
oldUnitPriceBigDecimalold_unit_priceYes—
newUnitPriceBigDecimalnew_unit_price——
changedAtLocalDateTimechanged_at——
changeReasonStringchange_reasonYes—

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
price@ManyToOneItemPriceprice_id—
item@ManyToOneInventoryItemitem_id—
changedBy@ManyToOneUserchanged_by—

Neighbourhood​

Repository​

ItemPriceHistoryRepository​

Declared over ItemPriceHistory with id type Integer. Source: backend/src/main/java/com/motorph/payroll/repository/ItemPriceHistoryRepository.java

MethodReturnsNotes
findByItem_ItemIdOrderByChangedAtDesc(Integer itemId)List<ItemPriceHistory>derived
findByPrice_PriceIdOrderByChangedAtDesc(Integer priceId)List<ItemPriceHistory>derived

Reached by​

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

ControllerBase pathEndpointsModule
ItemPriceController—6Inventory & 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/.