-
Uses a MySQL Database called
bamazon_db
. -
bamazon_db
contains a table inside of it calledproducts
. -
The products table has each of the following columns:
-
item_id (unique id for each product)
-
product_name (Name of product)
-
department_name
-
price (cost to customer)
-
stock_quantity (how much of the product is available in stores)
-
-
The database has about 19 different items.
-
Start bamazon's CLI
bamazonCustomer.js
. 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 user will then be prompted to confirm that they've selected the desired item (Y/N).
- The second message will ask how many units of the product they would like to buy.
- The first should ask them the ID of the product they would like to buy.
-
Once the customer has placed the order, the application will check if the store has enough of the product to meet the customer's request.
- If not, the app will log
Sorry, Insufficient inventory
, and then a message will appear asking if customer would like to proceed with their order (Y/N). If customer selects 'NO', the connection will end. If the customer selects 'YES', the prompt cycle will start over.
- If not, the app will log
-
However, if the store DOES have enough of the product, the customer's order will be fulfilled and will display the total of the purchase.
jessicavc / bamazon Goto Github PK
View Code? Open in Web Editor NEWCLI store