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. View the application here
- As a store owner
username: admin
andpassword: admin
- As a store attendant
username: user
andpassword: user
Admin
- Can add a new product
- Can view a list of all sales made by the attendants
Attendant
- Can make a sale
- Can view sales made by him/her
- Can view a single sale made by him/her
The API is hosted on heroku and below are the endpoints. Remember to include api/v1
at the end of the heroku url otherwise you will get a page not found error. Follow this link for the API documentation
Endpoint | Functionality | Notes |
---|---|---|
GET /api/v1/products | Fetch all products | Get all available products |
GET /api/v1/products/id | Fetch a single product record | Get a specific product using the product’s id |
GET /api/v1/admin/sales | Fetch all sale records | Get all sale records. This endpoint should be accessible to only the store owner/admin |
POST /api/v1/admin/products | Create a single product | Create a new product record. This endpoint should be accessible to only the store owner/admin. |
GET /api/v1/admin/sales/id | Fetch a single sales record | Get a specific sale record using the sale record Id. This endpoint is accessible to only the store owner/admin |
GET /api/v1/attendants/username/sales | Get all the sales by a single attendant | Get all sales made by a single attendant. This endpoint is accessible only by the attendant who made the sales |
Get /api/v1/attendants/username/sales/id | Fetch a single sale item by a specific attendant | Get a single sale made by a specific attendant. This endpoint is only accessible by the attendant who made the sale |
POST /api/v1/attendants/sales | create a single sales | This endpoint is accessed by only attendants to make sales |
- Python 3.6 or higher
- Flask 1.0.2 or higher
- Pytest for running tests
- Your favorite text editor
git clone https://github.com/fatukunda/Store-Manager.git
set FLASK_APP=app
flask run
- Run pytest
- Frank Atukunda - Initial work - Linkedin
- Andela Uganda
This project is part of the Andela bootcamp challenge