# new ReceivedShipmentManager(participantManager, callbackopt)
Received Shipment Manager Class - concrete ShipmentManager for received Shipments.
Received Shipment Manager Class - concrete ShipmentManager for received Shipments.
Manager Classes in this context should do the bridge between the controllers and the services exposing only the necessary api to the controllers while encapsulating all business logic.
All Manager Classes should be singletons.
This complete separation of concerts is very beneficial for 2 reasons:
- Allows for testing since there's no browser dependent code (i think) since the DSUStorage can be 'mocked'
- Allows for different controllers access different business logic when necessary (while benefiting from the singleton behaviour)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
participantManager |
ParticipantManager
|
||
callback |
function
|
<optional> |
optional callback for when the assurance that the table has already been indexed is required. |
Extends
Methods
# protected _genCompostKey(otherParticipantId, shipmentId) → {string}
generates the db's key for the Shipment
.generates the db's key for the Shipment
Parameters:
| Name | Type | Description |
|---|---|---|
otherParticipantId |
string
|
number
|
|
shipmentId |
string
|
number
|
- Inherited From:
string
# protected _getDSUInfo(keySSI, callback)
Util function that loads a ShipmentDSU and reads its information
.Util function that loads a ShipmentDSU and reads its information
Parameters:
| Name | Type | Description |
|---|---|---|
keySSI |
string
|
KeySSI
|
|
callback |
function
|
- Inherited From:
# protected _indexItem(keyopt, item, record) → {any}
Must wrap the entry in an object like:
{
index1: ...
Must wrap the entry in an object like:
{
index1: ...
index2: ...
value: item
}
so the DB can be queried by each of the indexes and still allow for lazy loading
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
key |
string
|
<optional> |
|
item |
Shipment
|
||
record |
string
|
object
|
- Inherited From:
the indexed object to be stored in the db
any
# getOne(key, readDSUopt, callback)
reads ssi for that gtin in the db.
reads ssi for that gtin in the db. loads is and reads the info at '/info'
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
key |
string
|
||
readDSU |
boolean
|
<optional> |
defaults to true. decides if the manager loads and reads from the dsu or not |
callback |
function
|
returns the Product if readDSU and the dsu, the keySSI otherwise |
- Inherited From:
# sendShipmentLinesToMAH(shipmentLines, shipmentLinesSSI, callback) → {*}
messages to all MAHs.
messages to all MAHs. the shipment is the same for the orderlines and their ssis because of the way the code is written
Parameters:
| Name | Type | Description |
|---|---|---|
shipmentLines |
||
shipmentLinesSSI |
||
callback |
- Inherited From:
*