WarehouseLocation
The WarehouseLocation entity, mapped to the warehouse_location table.
| Table | warehouse_location |
| Tenant-scoped | Yes — extends TenantOwned |
| Columns | 7 |
| Relationships | 2 |
| Source | backend/src/main/java/com/motorph/payroll/model/WarehouseLocation.java |
Columns
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
locationId | Integer | location_id | — | primary key, generated |
zone | String | zone | Yes | — |
binCode | String | bin_code | — | — |
description | String | description | Yes | — |
locationType | String | location_type | — | — |
active | boolean | is_active | — | — |
sortOrder | int | sort_order | — | — |
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 |
|---|---|---|---|---|
warehouse | @ManyToOne | Warehouse | warehouse_id | Yes |
parent | @ManyToOne | WarehouseLocation | parent_location_id | — |
Referenced by
| Entity | Field | Kind |
|---|---|---|
| InventoryLot | location | @ManyToOne |
| InventoryStock | location | @ManyToOne |
| ItemSerial | location | @ManyToOne |
| PurchaseReceivingItem | location | @ManyToOne |
| StockTransaction | location | @ManyToOne |
| WarehouseLocation | parent | @ManyToOne |
| WarehouseTransfer | fromLocation | @ManyToOne |
| WarehouseTransfer | toLocation | @ManyToOne |
Neighbourhood
Repository
WarehouseLocationRepository
Declared over WarehouseLocation with id type Integer. Source: backend/src/main/java/com/motorph/payroll/repository/WarehouseLocationRepository.java
| Method | Returns | Notes |
|---|---|---|
findAllByWarehouse_WarehouseId(Integer warehouseId) | List<WarehouseLocation> | derived |
existsByWarehouse_WarehouseIdAndBinCodeIgnoreCase(Integer warehouseId, String binCode) | boolean | derived |
existsByWarehouse_WarehouseIdAndBinCodeIgnoreCaseAndLocationIdNot(Integer warehouseId, String binCode, Integer locationId) | boolean | derived |
existsByWarehouse_WarehouseId(Integer warehouseId) | boolean | derived |
existsByParent_LocationIdAndActiveTrue(Integer parentLocationId) | boolean | derived |
findAllByWarehouse_WarehouseIdAndActiveTrue(Integer warehouseId) | List<WarehouseLocation> | derived |
findLocationsWithStockByWarehouseId(Integer warehouseId) | List<WarehouseLocation> | explicit @Query |
Reached by
These controllers hold — directly or through a service they depend on — a repository over WarehouseLocation.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| InventoryController | /api/inventory | 38 | Inventory & Portal |
| SerialLotController | /api/inventory | 5 | 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/.