AY2425S1-CS2113-W14-1 / tp

0 stars 5 forks source link

Budget allows invalid input #241

Closed TPH777 closed 2 days ago

TPH777 commented 2 days ago
  1. During initialisation image

  2. Incorrect exception for string input during initialisation image

  3. Budget command: image

TPH777 commented 2 days ago

It can be due to me not handling the merge conflict well, will check again later

TPH777 commented 2 days ago
  1. Problem: amount being set before checking whether if it is valid, causing it to exit the while loop in all the initialiseBudget() method, so the budgets are still uninitalised at the end.

    • Solution: Instead of amount, the conditional will query the budget from spendings directly.
  2. Problem: 'BUDGET_COMMAND_FORMATis used in all theinitialiseBudget()`

    • Solution: Use DUMMY_STRING instead.
  3. Problem: smallerBudget not being checked whether is it below MINIMUM_AMOUNT_ENTERED, though setBudget() passed the userInput budget to it.

    • Solution: Include checkUserBudgetEntered(DUMMY_AMOUNT, budget, DAILY_BUDGET, MONTHLY_BUDGET); in daily budget setting