StockTransaction
The StockTransaction entity, mapped to the stock_transaction table.
| Table | stock_transaction |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 8 |
| Relationships | 3 |
| Source | backend/src/main/java/com/motorph/payroll/model/StockTransaction.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
transactionId | Integer | transaction_id | — | primary key, generated |
transactionType | String | transaction_type | — | — |
quantity | Integer | quantity | — | — |
referenceNo | String | reference_no | Yes | — |
notes | String | notes | Yes | — |
serialNo | String | serial_no | Yes | — |
lotNo | String | lot_no | Yes | — |
createdAt | LocalDateTime | created_at | — | — |
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 |
|---|---|---|---|---|
item | @ManyToOne | InventoryItem | item_id | Yes |
location | @ManyToOne | WarehouseLocation | location_id | Yes |
performedBy | @ManyToOne | User | performed_by | — |
Neighbourhood
Repository
StockTransactionRepository
Declared over StockTransaction with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/StockTransactionRepository.java
| Method | Returns | Notes |
|---|---|---|
findAllByItem_ItemId(Integer itemId, Pageable pageable) | Page<StockTransaction> | derived |
findAllByOrderByCreatedAtDesc(Pageable pageable) | Page<StockTransaction> | derived |
Reached by
These controllers hold — directly or through a service they depend on — a repository over StockTransaction.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| InventoryController | /api/inventory | 38 | Inventory & Portal |
| WarehouseTransferController | /api/inventory/transfers | 2 | 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/.