Constructor
new warehouses(alogger)
Parameters:
Name |
Type |
Description |
alogger |
object
|
Logger to be used by instance (usually req.app.logger) |
- Source:
Methods
addWarehouse(data, callback)
Adds a new warehouse to core database
Parameters:
Name |
Type |
Description |
data |
object
|
form fields data (usually req.body) |
callback |
function
|
success (true or false) |
- Source:
approveRemoveForWarehouse(whId, callback)
Checks if a warehouse can be deleted or not.
Can not be deleted if there exist referenced subwarehouses or assets are directly attached
Parameters:
Name |
Type |
Description |
whId |
integer
|
|
callback |
function
|
|
- Source:
editWarehouse(reqBody, whId, callback)
Parameters:
Name |
Type |
Description |
reqBody |
object
|
form fields data (usually req.body) |
whId |
integer
|
id of warehouse to be updated |
callback |
function
|
success (true or false) |
- Source:
getListOfWarehouses(callback)
Returns list of all warehouses
Parameters:
Name |
Type |
Description |
callback |
function
|
rows or null |
- Source:
getListOfWarehousesForLocationId(locationId, callback)
Returns warehouses for given location
Parameters:
Name |
Type |
Description |
locationId |
integer
|
id of location object the warehouses should be returned for |
callback |
function
|
rows or null |
- Source:
getListOfWarehousesForOrganizationId(organizationId, callback)
Parameters:
Name |
Type |
Description |
organizationId |
integer
|
id of organization the warehouses should be returned for |
callback |
function
|
rows or null |
- Source:
getListOfWarehousesForTable(callback)
Returns list of all Warenhouses for list view in UI
Parameters:
Name |
Type |
Description |
callback |
function
|
rows or null |
- Source:
getWarehousePathFromParentWarehouse(pwId, callback)
Returns warehouse path of parent warehouse given in pwId
Parameters:
Name |
Type |
Description |
pwId |
integer
|
id of parentWarehouse |
callback |
string
|
parent warehouse path as string |
- Source:
getWarehouseWithId(wId, callback)
Returns a single warehouse with given warehouse id from core database
Parameters:
Name |
Type |
Description |
wId |
integer
|
id of warehouse to load from core database |
callback |
*
|
row or null |
- Source:
removeWarehouse(whId, callback)
Removes a warehouse from core database, checks upfront if the warehouse can be deleted (if it does not have referenced subwarehouses)
Parameters:
Name |
Type |
Description |
whId |
integer
|
id of warehouse to be deleted from core database |
callback |
function
|
success (true or false) |
- Source: