Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Latest commit

 

History

History
31 lines (27 loc) · 1.08 KB

File metadata and controls

31 lines (27 loc) · 1.08 KB

Approval-API

Folder Structure

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 manager which adds makes the manager ready to be used externally or for the handler
  • data/ contains all data level operations (db/ cache etc) which directly manipulate the data, all these should only be used by the handler and not anywhere else directly
  • manager/ handles the business logic of the approval process and is used to approve/ deny items and uses the data files 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.