approval-api/
│ constants.js
│ handler.js
│ index.js
│
└─── data/
│ create.js
│ delete.js
│ get.js
│
└─── manager/
│ approve.js
│ deny.js
│
└─── resource/
│ edge.js
│ poi.js
│ user.js
- handler.js is a delegator responsible for the lambda api
- index.js is a wrapper for the
managerwhich adds makes the manager ready to be used externally or for thehandler - data/ contains all data level operations (db/ cache etc) which directly manipulate the data, all these should only be used by the
handlerand not anywhere else directly - manager/ handles the business logic of the approval process and is used to approve/ deny items and uses the
datafiles to manipulate the data
The index.js is the only file that should be used as an api to use the approval api features. manager or data should never be used directly anywhere else then in th index.js. Only the manager is allowed to use the data files.