Class

ReceivedShipmentManager

Managers.ReceivedShipmentManager(participantManager, callbackopt)

Constructor

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

View Source managers/ReceivedShipmentManager.js, line 8

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:

View Source managers/ShipmentManager.js, line 32

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:

View Source managers/ShipmentManager.js, line 43

# 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:

View Source managers/ShipmentManager.js, line 64

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:

View Source managers/ShipmentManager.js, line 86

# 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:

View Source managers/ShipmentManager.js, line 109

*

# update(keyopt, shipment, callback)

updates an item

.

updates an item

Parameters:
Name Type Attributes Description
key string <optional>

key is optional so child classes can override them

shipment Shipment
callback function
Inherited From:

View Source managers/ShipmentManager.js, line 163