Skip to content

Sails API service to model the current inventory, deducting from inventory as orders are created, and adding inventory back if orders are canceled

Notifications You must be signed in to change notification settings

samsonmaconi/TreezServ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 

Repository files navigation

TreezServ

Treez service to model the current inventory, deducting from inventory as orders are created, and adding inventory back if orders are canceled

Documentation

Kindly review the Postman Documentation for more insight into the API.

Frameworks and Libraries

Installation Instructions

  • run cd service to navigate to the service root directory
  • run npm i to install the required packages

Testing Instructions

  • run npm test to execute the tests

Server Startup Instructions

The more relevant Files and Directories

  • service/api/models - Model definitions representing database tables/collections. Showing their attributes incuding relationships to other models.
  • service/api/controllers - Server-side actions for handling incoming requests. Showing validation schemas and requests handling.
  • service/tests - Tests directory
  • service/config/bootstrap.js - For seeding the app with fake data before sails is lifted.
  • service/config/routes.js - API Endpoints config

NOTE

I made a compromise on the choice of datastore. I chose to use sails-disk (more ideal for Development env not Production) to allow easier evaluation setup as no extra DB setup is nessary. However, the datastore of your choice can be used by simply specifying the adapter and url of your database within the service/config/datastore.js file by replacing the following block of code with your appropriate datastore parameters.

    // adapter: 'sails-mysql',
    // url: 'mysql://user:password@host:port/database',

In addition to some minor code refactoring, the service could also benefit from detailed logging of all requests and responses to aid debugging process.

About

Sails API service to model the current inventory, deducting from inventory as orders are created, and adding inventory back if orders are canceled

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published