Skip to main content

StockTransaction

The StockTransaction entity, mapped to the stock_transaction table.

Tablestock_transaction
Tenant-scopedYes — extends TenantOwned
Columns8
Relationships3
Sourcebackend/src/main/java/com/motorph/payroll/model/StockTransaction.java

Columns​

FieldTypeColumnNullNotes
transactionIdIntegertransaction_id—primary key, generated
transactionTypeStringtransaction_type——
quantityIntegerquantity——
referenceNoStringreference_noYes—
notesStringnotesYes—
serialNoStringserial_noYes—
lotNoStringlot_noYes—
createdAtLocalDateTimecreated_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​

FieldKindTargetJoin columnRequired
item@ManyToOneInventoryItemitem_idYes
location@ManyToOneWarehouseLocationlocation_idYes
performedBy@ManyToOneUserperformed_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

MethodReturnsNotes
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.

ControllerBase pathEndpointsModule
InventoryController/api/inventory38Inventory & 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/.