Bamazon is a CLI application using Node.js and MySQL that allow users to take orders and update stock items from the store's inventory.
This application was an assignment for GA Tech's Coding Program, Full-Time Fall 2017 Cohort.
- Create a new Node.js application called bamazonManager.js that will run:
-
List of set of menu options:
- View Products for Sale
- View Low Inventory
- Add to Inventory
- Add New Product
-
If a manager selects
View Products for Sale
, the app should list every available item: the item IDs, names, prices, and quantities. -
If a manager selects
View Low Inventory
, then it should list all items with an inventory count lower than five. -
If a manager selects
Add to Inventory
, your app should display a prompt that will let the manager "add more" of any item currently in the store. -
If a manager selects
Add New Product
, it should allow the manager to add a completely new product to the store.
- Create a new MySQL table called
departments
. Your table should include the following columns:
- department_id
- department_name
- over_head_costs (A dummy number you set for each department)
-
Modify the products table so that there's a product_sales column and modify the
bamazonCustomer.js
app so that this value is updated with each individual products total revenue from each sale. -
Modify your
bamazonCustomer.js
app so that when a customer purchases anything from the store, the price of the product multiplied by the quantity purchased is added to the product's product_sales column.- Make sure your app still updates the inventory listed in the
products
column.
- Make sure your app still updates the inventory listed in the
-
Create another Node app called
bamazonSupervisor.js
. Running this application will list a set of menu options:- View Product Sales by Department
- Create New Department
-
When a supervisor selects
View Product Sales by Department
, the app should display a summarized table in their terminal/bash window. Use the table below as a guide.
department_id | department_name | over_head_costs | product_sales | total_profit |
---|---|---|---|---|
01 | Electronics | 10000 | 20000 | 10000 |
02 | Clothing | 60000 | 100000 | 40000 |
-
The
total_profit
column should be calculated on the fly using the difference betweenover_head_costs
andproduct_sales
.total_profit
should not be stored in any database. You should use a custom alias. -
If you can't get the table to display properly after a few hours, then feel free to go back and just add
total_profit
to thedepartments
table.
- Manager View
- Supervisor View
- Fork this repository
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
- Tom McCarthy, Full Stack Developer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.