homework wk12 - Node.js & MySQL
INSTRUCTIONS FOR USE:
Node Package Manager instructions:
This CLI application requires the use of inquirer and mysql
From the git bash command line, run the commands: npm install mysql npm install inquirer
This repository contains two applications:
Description: Running this application will first display all of the items available for sale. Include the ids, names, and prices of products for sale.
The app should then prompt users with two messages.
The first should ask them the ID of the product they would like to buy.
The second message should ask how many units of the product they would like to buy.
Once the customer has placed the order, the application checks if the store has enough of the product to meet the customer’s request.
If not, the app responds back with message “Insufficient quantity!”, and then prevents the order from going through.
However, if the store does have enough of the product, it will fulfill the customer’s order.
This application will update the SQL database to reflect the remaining quantity.
Once the update goes through, show the customer the total cost of their purchase.
Running this application will:
When a manager selects View Products for Sale, the app should list every available item: the item IDs, names, prices, and quantities.
When a manager selects View Low Inventory, this will list all items with an inventory count lower than five.
When a manager selects Add to Inventory, the application displays a prompt that will let the manager “add more” of any item currently in the store.
When a manager selects Add New Product, it allows the manager to add a completely new product to the store.
Selecting Exit will exit you from the application