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)
Classes
- BatchManager
Batch Manager Class
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.
- DirectoryManager
Stores references to some entities for quicker lookup on the front end (eg, products, suppliers, etc)
.- IndividualProductManager
IndividualProduct Manager Class
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.
- IssuedOrderManager
- Issued Order Manager Class - concrete OrderManager for issuedOrders.
- IssuedShipmentManager
- Issued Shipment Manager Class - concrete ShipmentManager for issuedShipments.
- NotificationManager
Batch Manager Class
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.
- OrderManager
Order Manager Class
Abstract class.
- ParticipantManager
Participant Manager Class - Extension of Base Manager
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.
- ProductManager
Product Manager Class
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.
- ReceiptManager
Stock Manager Class
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.
- ReceivedOrderManager
- Received Order Manager Class - concrete OrderManager for receivedOrders.
- ReceivedShipmentManager
- Received Shipment Manager Class - concrete ShipmentManager for received Shipments.
- SaleManager
Stock Manager Class
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.
- ShipmentLineManager
ShipmentLine Manager Class
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.
- ShipmentManager
Shipment Manager Class
Abstract class.
- StockManager
Stock Manager Class
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.
- TraceabilityManager
Stock Manager Class
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.
Methods
# static getBatchManager(participantManager, callbackopt) → {BatchManager}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
participantManager |
BaseManager
|
||
callback |
function
|
<optional> |
optional callback for when the assurance that the table has already been indexed is required. |
# static getDirectoryManager(participantManager, callbackopt) → {DirectoryManager}
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. |
# static getIndividualProductManager(participantManageropt, callbackopt) → {IndividualProductManager}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
participantManager |
ParticipantManager
|
<optional> |
only required the first time, if not forced |
callback |
function
|
<optional> |
optional callback for when the assurance that the table has already been indexed is required. |
# static getIssuedOrderManager(participantManager, callbackopt) → {IssuedOrderManager}
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. |
# static getIssuedShipmentManager(participantManager, callbackopt) → {IssuedShipmentManager}
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. |
# static getNotificationManager(participantManager, callbackopt) → {NotificationManager}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
participantManager |
BaseManager
|
||
callback |
function
|
<optional> |
optional callback for when the assurance that the table has already been indexed is required. |
# static getParticipantManager(dsuStorageopt, forceopt, callbackopt) → {ParticipantManager}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
dsuStorage |
DSUStorage
|
<optional> |
only required the first time, if not forced |
force |
boolean
|
<optional> |
defaults to false. overrides the singleton behaviour and forces a new instance. Makes DSU Storage required again! |
callback |
function
|
<optional> |
# static getProductManager(participantManageropt, callbackopt) → {ProductManager}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
participantManager |
ParticipantManager
|
<optional> |
only required the first time, if not forced |
callback |
function
|
<optional> |
optional callback for when the assurance that the table has already been indexed is required. |
# static getReceiptManager(participantManager, callbackopt) → {ReceiptManager}
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. |
# static getReceivedOrderManager(participantManager, callbackopt) → {OrderManager}
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. |
# static getReceivedShipmentManager(participantManager, callbackopt) → {ReceivedShipmentManager}
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. |
# static getSaleManager(participantManager, callbackopt) → {SaleManager}
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. |
# static getShipmentLineManager(participantManager, callbackopt) → {ShipmentLineManager}
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. |
# static getStockManager(participantManager, serializationopt, callbackopt) → {StockManager}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
participantManager |
ParticipantManager
|
||
serialization |
boolean
|
<optional> |
defaults to true. |
callback |
function
|
<optional> |
optional callback for when the assurance that the table has already been indexed is required. |
# static getTraceabilityManager(participantManager, callbackopt) → {TraceabilityManager}
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. |