Node.js-MySQL

AUTHOR: Lisa Michael - ROLE: DEVELOPER
HW: WK10 - Node.js-MySQL aka bamazon
url: https://lisamichael.github.io/Node.js-MySQL/.

Node.js-MySQL

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:

Customer View: bamazonCustomer.js

Description: Running this application will first display all of the items available for sale. Include the ids, names, and prices of products for sale. image

The app should then prompt users with two messages.

The first should ask them the ID of the product they would like to buy. image

The second message should ask how many units of the product they would like to buy.

image

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.

image

However, if the store does have enough of the product, it will fulfill the customer’s order. image

This application will update the SQL database to reflect the remaining quantity.

image

Once the update goes through, show the customer the total cost of their purchase.

image

Manager View: bamazonManager.js

Running this application will:

List a set of menu options:

image

View Products for Sale:

When a manager selects View Products for Sale, the app should list every available item: the item IDs, names, prices, and quantities.

image

View Low Inventory

When a manager selects View Low Inventory, this will list all items with an inventory count lower than five.

image

Add to Inventory

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.

image

image

image

Add New Product

When a manager selects Add New Product, it allows the manager to add a completely new product to the store.

image

image

Exit

Selecting Exit will exit you from the application