Constructor
new assets(alogger)
Parameters:
Name |
Type |
Description |
alogger |
object
|
Logger to be used in class methods (usually req.app.logger) |
- Source:
Methods
addAsset(reqBody, callback)
Adds a new asset to core database
Parameters:
Name |
Type |
Description |
reqBody |
object
|
form data (usually req.body) |
callback |
function
|
success (true / false) |
- Source:
getAllAssetsWhichCanBeAlarmed(callback)
Returns all assets which can be alarmed (isGear === 1)
Parameters:
Name |
Type |
Description |
callback |
function
|
rows or null |
- Source:
getAssetForISSI(issi, callback)
Returns a single asset from core database for given issi - number
Parameters:
Name |
Type |
Description |
issi |
integer
|
issi to look for |
callback |
function
|
rows or null |
- Source:
getAssetsForWarehouse(wId, callback)
Returns list of assets in given warehouse
Parameters:
Name |
Type |
Description |
wId |
integer
|
id of warehouse assets shall be loaded for |
callback |
function
|
rows or null |
- Source:
getAssetwithId(assetId, callback)
Returns a single asset from core database
Parameters:
Name |
Type |
Description |
assetId |
integer
|
id of asset to be returned out of core database |
callback |
*
|
row or null |
- Source:
getListOfAssets(callback)
Returns all assets for display in UI view
Parameters:
Name |
Type |
Description |
callback |
function
|
rows or null |
- Source:
getListOfAssetsStates(callback)
Returns list of asset states from core database
Parameters:
Name |
Type |
Description |
callback |
function
|
rows or null |
- Source:
removeAsset(assetId, callback)
Removes an asset and referenced assets parameters from core database
Parameters:
Name |
Type |
Description |
assetId |
integer
|
id of asset to be removed from database |
callback |
function
|
success (true or false) |
- Source: