Enables a new user to sign up into the application. _Router_ used 'api/v1/users' POST METHOD.
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.
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.
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.
pP>No access token required.Enables a user to get a single product from the inventory. _Router used_'api/v1/products/1' POST METHODOnly 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
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.
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.
- Open a repo in github
- Clone the repository into the local machine through the terminal by: git clone https://github.com/winniekariuki/Challenge2.git
- Create a virtual enviroment with the command $ virtualenv -p python3 env
- Activate the virtual enviroment with the command `Desktop/ApplicationStore/env/Scripts/activate`
- cd back into the ApplicationStore where you include all your code related files.
- Install requirements $ pip install -r requirements.txt
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'