Skip to content
Bangazon - Sprint 2
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
app
bin
data
db
test
.gitignore
README.md
bangazonCLI.png
package-lock.json
package.json

README.md

Bangazon Command Line Interface

About

In this group project, we allow a user to interact with a basic product ordering database for a customer via a command line interface.

How To Use For a Customer

  1. Clone it down to your computer
  2. Run node run db:reset
  3. Run (npm i -g and bangazon) or (node app/cli.js)
  4. To select a current customer
    1. Run 2
    2. Select a customer by their id from the given list.
  5. To select an existing customer
    1. Run 1
    2. Follow the prompts to create them, then go back to step 4 to select them.
  6. You're ready to work for the customer!

How To Contribute

  1. Fork this project to your repo
  2. Clone it down to your computer
  3. Create a new branch - git chekout -b [your new branch name]
  4. Run npm install
  5. You can test by running node app/cli.js
  6. You're ready to contribute!

Main Menu Commands

*********************************************************
**  Welcome to Bangazon! Command Line Ordering System  **
*********************************************************
  1. Create a customer account
  2. Choose active customer
  3. Create a payment option
  4. Add product to inventory
  5. Complete an order
  6. See product popularity
  7. View stale products
  8. Update a product
  9. Remove a product
  10. Add to cart
  11. Leave Bangazon!

> [input id command]
  1. Create a customer account

This command allows user to add a new customer to the database. When running command #1, user will be prompted to enter the following:

Enter Customer Name (First Last):   ///will be split into seperate columns in DB
Enter Address:                      /// only Street# + Road Name
Enter City: 
Enter State:                        ///only uppercase abbreviation (e.g., GA)
Enter ZIP:                          ///6 digits
Enter Phone:                        ///10 digit as: 111-222-3333

Following prompt input, terminal will send confirmation:

<customer name> has been added to the database

The prompt will then return to the main menu.

  1. Choose active customer

    Select a customer by their id to be used by the rest of the program. You cannot select a customer that does not exist.

  2. Create a payment option

    *An active customer must be selected to proceed with this process (refer to Option 2 for more information on selecting an active customer)

    Select one of the available payment methods by entering an exact match of the name.

    AmEx
    

    Enter just the digits of an account number. (Without "-" or spaces)

    1234567891011121314
    

    The following message should display:

    [payment name] payment added
    
  3. Add product to inventory

This command allows user to add a new new products to a customer's inventory in the database. When running command #4, user will be prompted to enter the following:

Enter Product Name:
Enter Product Type:                 /// #1-11
Enter Price: 
Enter Brief description:            
Enter Quantity Available:           ///6 digits

Following prompt input, terminal will send confirmation:

<product name> has been added to line <new product id>

The prompt will then return to the main menu.

  1. Complete an order

    *An active customer must be selected to proceed with this process (refer to Option 2 for more information on selecting an active customer)

    Given a customer has an open order, with products on the order, entering this option will display the following message:

    Bangazon Corp:  Your order total is [customer's order total]. Please select Y or N to confirm or cancel payment (Y/N):
    

    Here you must select "Y" in uppercase to continue. "N" will return to the main menu.

    If "Y" is selected, a list of the active customer's payments types will appear with the following message:

    AmEx 55502077
    PayPal 77676200
    Bangazon Corp:  Enter desired payment type account number: 
    

    Here, a listed account number must be correctly typed or an error message will be given.

    Given a correct account number is entered, the order will be complete, a payment type added to the order making no products available to be added to the order, and quantities for the purchased items inventory will be reduced based on quanitity purchased and the following message will display:

    Order payment successful
    

    Upon completion, the main menu will appear again.

  2. See product popularity

    View product popularity to show top 3 products and their revenue of given customer.

      Product             Orders     Purchasers     Revenue
      *******************************************************
      Practical Cotton    1          1              $25
      Chair
      Practical Steel     1          1              $25
      Towels
      *******************************************************
      Total:              2          2              $50
    
  3. View stale products

    View customers products that are not currently selling.

     id           Name
    **********  *********************
      9         Handmade Granite Ball
    
      Press any key to continue
    
  4. Update a product

    *An active customer must be selected to proceed with this process (refer to Option 2 for more information on selecting an active customer)

    Select one of the available products by entering the corresponding list number.
    Enter the number for the desired attribute to update. i.e. 1
    Enter the new value.
    The following message should display (followed by the Main Menu):

    [product attribute] updated
    
  5. Remove a product

    • Choose an active customer by selecting num. 2 from the list
    • You will be given a list of customers. Choose which one to be made active
    • Once an active customer is choosen, you will be brought back to the main menu
    • Navigate to remove product, which is labeled as num. 9
    • Once that is selected, you will be given a list of products that can be deleted
    • Choose a product to be removed
  6. Add to cart

    *An active customer must be selected to proceed with this process (refer to Option 2 for more information on selecting an active customer)

    Select a product by entering the corresponding list number.
    The following message should display (followed by the Main Menu):

    Product added to order
    
  7. View Customer Revenue

After an active customer has been selected (command #2 in Bangazon Main Menu), you can view the accrued revenue for specified customer, printing: - individual products per order (including quanity purchased in order + accrued total of the purchased product quantity) - total revenue from all of customer's purchased products on all orders from Bangazon

When initiating command #11 in main menu, after activating a customer, a table of accrued revenue will be printed to the terminal, (e.g., revenue table for customer #8 -- Ben Gentle):

Order#4
----------------------------------------------------
Fantastic Wooden Shoes          1          $379

Order#10
----------------------------------------------------
Refined Fresh Tuna              1          $39

Order#13
----------------------------------------------------
Ergonomic Frozen Chicken        1          $126

Order#14
----------------------------------------------------
Ergonomic Frozen Chicken        1          $126

Total revenue: $670

After the table is printed to the terminal, the main menu will print (following the revenue table) and prompt the user to continue with another command

  1. Leave Bangazon!

Technologies used

  1. Node
  2. Prompt
  3. Console.Table
  4. Cliui
  5. Chalk
  6. Colors
  7. Sqlectron
You can’t perform that action at this time.