UC7: PurchaseBeverage - Jomsaruj/coffeemaker GitHub Wiki

7.1 Preconditions:

  • None

7.2 Main Flow:

  • The user will select the beverage they wish to purchase. The user will deposit money to pay for the beverage. [S1][S2]

7.3 Subflows:

  • [S1] The CoffeeMaker will check if there are enough ingredients in the inventory to make the selected drink. [E1]

  • [S2] The CoffeeMaker will make sure enough money was deposited [E2], the beverage will be dispensed, and any extra change will be returned.

7.4 Alternative Flows:

  • [E1] If there is not enough inventory to make the beverage, a message will be displayed, the user's money will be returned, and the user will be returned to the main menu.

  • [E2] If the user does not enter enough money, their money will be returned, and the user will be returned to the main menu.

  • [E3] If the user selects a number that does not correspond to a recipe, the user's money will be returned, and the user will be returned to the main menu.