ItemPriceHistory
The ItemPriceHistory entity, mapped to the item_price_history table.
| Table | item_price_history |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 5 |
| Relationships | 3 |
| Source | backend/src/main/java/com/motorph/payroll/model/ItemPriceHistory.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
historyId | Integer | history_id | — | primary key, generated |
oldUnitPrice | BigDecimal | old_unit_price | Yes | — |
newUnitPrice | BigDecimal | new_unit_price | — | — |
changedAt | LocalDateTime | changed_at | — | — |
changeReason | String | change_reason | Yes | — |
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 |
|---|---|---|---|---|
price | @ManyToOne | ItemPrice | price_id | — |
item | @ManyToOne | InventoryItem | item_id | — |
changedBy | @ManyToOne | User | changed_by | — |
Neighbourhood
Repository
ItemPriceHistoryRepository
Declared over ItemPriceHistory with id type Integer. Source: backend/src/main/java/com/motorph/payroll/repository/ItemPriceHistoryRepository.java
| Method | Returns | Notes |
|---|---|---|
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.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| ItemPriceController | — | 6 | 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/.