Skip to content

Store Manager is a web application that helps store owners manage sales and product inventory records. This application is meant for use in a single store.

Notifications You must be signed in to change notification settings

winniekariuki/Challenge2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ApplicationStore

Build Status Coverage Status Maintainability

Store Manager is a web application that helps store owners manage sales and product inventory records. This application is meant for use in a single store.

Sign up endpoint

Enables a new user to sign up into the application. _Router_ used 'api/v1/users' POST METHOD.

Login endpoint

Enables a registered user to login into the application after which an access token is assigned to him/her to enable him/her to access authenticated endpoints. _Router used_'api/v1/login' POST METHOD.

Post Product endpoint

Enables the store admin to create a new product and post. Only the store admin can access this endpoint. _Router used_'api/v1/products' POST METHOD.

GET product endpoint

No access token required.The endpoint enables a user to view all the available products in the inventory. _Router used_'api/v1/products' GET METHOD.

GET Single product

pP>No access token required.Enables a user to get a single product from the inventory. _Router used_'api/v1/products/1' POST METHOD

POST sale endpoint

Only the store attendant is allowed to access this endpoint. Enables the store attendant to post a sale record by passing the sale 'id' which in return posts the sale 'id' and the product details which include price of the product,name and model_no. _Router used_'api/v1/sales' POST METHOD

Get all sales endpoint

The endpoint allows the admin to get all the sale records posted by the store attendants.Only accessible by the admin. _Router used_'api/v1/sales' GET METHOD.

Get single sale record endpoint

The endpoint is only accessible to the store attendant who created it and the store admin. Enables the two to get the sale record. _Router used-'api/v1/sales/1' GET METHOD.

Installation

  1. Open a repo in github
  2. Clone the repository into the local machine through the terminal by: git clone https://github.com/winniekariuki/Challenge2.git
  3. Create a virtual enviroment with the command $ virtualenv -p python3 env
  4. Activate the virtual enviroment with the command `Desktop/ApplicationStore/env/Scripts/activate`
  5. cd back into the ApplicationStore where you include all your code related files.
  6. Install requirements $ pip install -r requirements.txt

How to test

The endpoints can be tested through the postman by sending the link gotten from the terminal after running the app with the their respective routers

To test if the tests pass you run the pytest command in the terminal but before that one has to pass the the secret using the command $ set SECRET_KEY='thisissecret'

Links

https://challeng.herokuapp.com
https://www.pivotaltracker.com/n/projects/2202841

About

Store Manager is a web application that helps store owners manage sales and product inventory records. This application is meant for use in a single store.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages