This is an Amazon-like storefront using MySQL a flavor of structured query languages available. The app will take in orders from customers and deplete stock from the store's inventory.
-
MySQL Database created.
-
A table inside of that database.
-
The table has five columns
-
Populate this database with around 10 different products. (i.e. Insert "mock" data rows into this database and table).
-
A Node application runs this application to display all of the items available for sale.
-
The app prompts 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 your store has enough of the product to meet the customer's request and displays a log a phrase like
Insufficient quantity!
if there isn't enough to fill the demand, then prevent the order from going through. -
If there is enough of the product, the customer's order is fulfilled.
- Once the update goes through, show the customer the total cost of their purchase.