Closes #6 :: User should be able to complete a customer order
Description of Proposed Changes
added a menu option to allow user to "Checkout" and close their active order
added logic to check inventory status of each product before offering to close the order(checkout).
added test to check functions needed to close an order, by adding payment type and date
refactored AddProductsToCart.cs to check product availability before displaying products that are available to add to an order, refactored if statements and user prompts
added code comments
Added RemoveProductFromOrder method to OrderManager to handle removing out of stock products from an order when closing the order
Added a test for the RemoveProductFromOrder method to OrderManagerShould.cs
added content to the readme
Steps to Test
Outline the steps to test
Start in your root directory for project
git fetch --all
git checkout gl-MenuCloseOrder
cd bangazon-cli.Tests
dotnet restore
dotnet test
ALL tests should pass.
Then navigate to bangazon-cli directory
..
cd bangazon-cli
dotnet run
In Bangazon-CLI:
Set an active customer via Menu Item 2.
If needed, create some payment options (Menu Item 3)
If needed, create some products (Menu Item 4)
If needed, add some products to an order (Menu Item 7).
Select Menu Item 8 to "Complete an Order".
Make sure the total amount of money shown is the correct amount based on the products in your cart.
Choose "Y" when prompted if "Ready to Purchase"
Choose a payment option.
Check that you see a SUCCESS message
Check database and see if there are any products with quantity of 1.
If there are, in the CLI, add them to an order and check out that order (Menu Item 8).
Go back and try to add that product to an order again and confirm that it is not listed as an option.
In DB Browser, manually change the quantity on that product to 0. CLICK: WRITE CHANGES
In Bangazon CLI, choose "N" to not checkout right now.
Choose Menu Item 8 to checkout that order again.
Confirm that you see a message stating that the product you changed the quantity on has been removed from your order
Confirm in DB Browser that the record in the Order Product Table for that product and order relationship has been removed.
Impacted Areas in Application
List general components of the application that this PR will affect:
AddProductsToCartMenu.cs
CloseOrderMenu.cs
OrderManager.cs
OrderManagerShould.cs
Readme.md
Mentions @username
Tag users that need to review this code
Definition of Done
The project must be fully documented. This includes the following:
Complete README that documents the steps to install the code, how to install any dependencies, or system configuration needed.
Every class must be documented with purpose, author, and methods.
Every method must be documented with purpose and argument list - which itself must contain a short purpose for each argument.
The project must be able to run fully, and without errors, on each teammate's system.
Fulfills every requirement.
Every line of code has been peer reviewed.
For projects that require unit testing, core functionality must be identified and have at least one test for each.
Link to Ticket
Closes #6 :: User should be able to complete a customer order
Description of Proposed Changes
Steps to Test
Outline the steps to test
Start in your root directory for project
ALL tests should pass.
Then navigate to bangazon-cli directory
In Bangazon-CLI:
Impacted Areas in Application
List general components of the application that this PR will affect:
Mentions @username
Tag users that need to review this code
Definition of Done