Skip to content

Commit

Permalink
Merge pull request #220 from Dheekshitha2/shree-DG-10
Browse files Browse the repository at this point in the history
Update sequence diagrams
  • Loading branch information
Dheekshitha2 authored Apr 13, 2024
2 parents 6956431 + 687e6bf commit 50dfc4c
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 8 deletions.
81 changes: 73 additions & 8 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,18 +453,18 @@ The user interaction for reducing savings follows these steps:

The following UML Sequence diagram below shows how the Reduce savings Feature Command is executed when a user
inputs a valid reduce savings command:
(will insert diagram soon)
![sequenceDiagram_ReduceSavings.png](diagrams/sequenceDiagram_ReduceSavings.png)

### 4.7 Delete Expenses Feature
The Delete Expense feature grants users the capability to remove expenses they have previously entered. Managed by the
DeleteExpenseCommand class, this feature is initialized through DeleteExpenseCommandCreator. During the creation process,
the command is provided with an `ExpenseList` object and an `index` indicating the specific expense to be deleted.
The following table outlines the significance of these attributes:

| Class Attribute | Variable Type | Relevance |
|-----------------|---------------|------------------------------------------------------------------------|
| expenses | ExpenseList | ExpenseList Object containing the list of expenses that can be edited |
| index | Integer | The edited category for the expense in the specified index |
| Class Attribute | Variable Type | Relevance |
|-----------------|---------------|-----------------------------------------------------------------------|
| expenses | ExpenseList | ExpenseList Object containing the list of expenses that can be edited |
| index | Integer | The edited category for the expense in the specified index |

On invocation of the `execute()` method, as part of the `command.execute() `flow within BudgetBuddy, the DeleteExpenseCommand
object engages the deleteExpense() method from the ExpenseList class.
Expand Down Expand Up @@ -875,7 +875,7 @@ process:

The UML Sequence diagram below illustrates the execution flow of the Set Budget Feature when a user inputs a valid
command to set a budget:
![sequenceDiagram_setBudget.jpg](diagrams/sequenceDiagram_setBudget.jpg)
![sequenceDiagram_setBudget.jpg](diagrams/sequenceDiagram_SetBudget.jpg)

The sequence of operations for an example input, `set budget c/Transport b/500`, is as follows:
1. BudgetBuddy receives the user input and utilizes the Parser to decipher it.
Expand All @@ -893,7 +893,7 @@ The sequence of operations for an example input, `set budget c/Transport b/500`,

The UML Sequence diagram below illustrates the execution flow of the Set Budget Feature when a user inputs a valid
command to list budgets:
![sequenceDiagram_listBudget.png](diagrams/sequenceDiagram_listBudget.png)
![sequenceDiagram_listBudget.png](diagrams/sequenceDiagram_ListBudget.png)

Upon the call of the `execute()` method in `BudgetBuddy` using `command.execute()`, `SetBudgetCommand` will update the
budget in `ExpenseList` using `setBudget`. Similarly, `ListBudgetCommand` will fetch and display all categories with
Expand Down Expand Up @@ -1045,6 +1045,71 @@ type fast. It also provides the ability to deal with finances on a singular plat
* 1.2.1 BudgetBuddy notifies user of the same conversion. <br>
Use case ends

<!-- @@author Dheekshitha2-->
### Use Case: Delete expenses

1. User requests to delete a specific expense by specifying the index
2. BudgetBuddy retrieves the specified expense from the stored expenses list.
3. BudgetBuddy deletes the specified expense.
4. BudgetBuddy displays a confirmation message indicating the expense has been deleted.

#### Extensions
* 1.1 User specifies an invalid or out-of-bounds index
* 1.1.1 BudgetBuddy shows an error message and prompts the user to enter a valid index. <br>
Use case ends.
* 2.1 BudgetBuddy retrieves an empty expense list
* 2.1.1 BudgetBuddy displays an error message indicating there are no expenses to delete. <br>
Use case ends.

<!-- @@author Dheekshitha2-->
### Use Case: Reduce Savings

1. User requests to reduce savings by specifying a category and amount.
2. BudgetBuddy retrieves savings associated with the specified category.
3. BudgetBuddy reduces the savings by the specified amount.
4. BudgetBuddy displays a confirmation message indicating the savings have been reduced.

#### Extensions
* 1.1 User specifies a category not present in the savings list.
* 1.1.1 BudgetBuddy shows an error message indicating the category does not exist. <br>
Use case ends.
* 1.2 User specifies an amount that exceeds the available savings in the category.
* 1.2.1 BudgetBuddy shows an error message indicating insufficient savings for the reduction. <br>
Use case ends.
* 2.1 BudgetBuddy retrieves an empty savings list.
* 2.1.1 BudgetBuddy displays an error message indicating there are no savings to reduce. <br>
Use case ends.

<!-- @@author Dheekshitha2-->
### Use Case: Listing Budget

1. User requests to list budgets.
2. BudgetBuddy retrieves all set budgets along with their associated categories.
3. BudgetBuddy displays each category with its corresponding budget limit.
4. BudgetBuddy also displays the total of all budgets combined.

#### Extensions
* 2.1 BudgetBuddy retrieves an empty budget list.
* 2.1.1 BudgetBuddy displays a message indicating no budgets have been set. <br>
Use case ends.

<!-- @@author Dheekshitha2-->
### Use Case: Setting Budget

1. User requests to set a budget for a specific category by specifying the category and the budget amount.
2. BudgetBuddy checks if the category exists; if not, it adds the category.
3. BudgetBuddy sets or updates the budget for the specified category.
4. BudgetBuddy displays a confirmation message indicating the budget has been set or updated.

#### Extensions
* 1.1 User specifies an invalid or non-numeric budget amount.
* 1.1.1 BudgetBuddy shows an error message and prompts the user to enter a valid numerical amount. <br>
Use case ends.
* 1.2 User sets a budget amount to zero or a negative number.
* 1.2.1 BudgetBuddy shows an error message indicating the budget amount must be positive. <br>
Use case ends.


## Appendix D: Non-Functional Requirements

1. Should work on any *mainstream OS* as long as it has Java `11` or above installed.
Expand All @@ -1055,7 +1120,7 @@ type fast. It also provides the ability to deal with finances on a singular plat
## Appendix E: Glossary

* **Mainstream OS**: Windows, Linux, macOS.
* **Securring Expenses*: A set of expenses which can be added to the overall expenses at any given point in time
* **Securing Expenses*: A set of expenses which can be added to the overall expenses at any given point in time
* **Overall Expenses**: Refers to the overall expense list. Etc, the expense list which expenses get added to when performing an add expense command.

## Appendix F: Instructions for manual testing
Expand Down
Binary file added docs/diagrams/sequenceDiagram_ListBudget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/diagrams/sequenceDiagram_ReduceSavings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/diagrams/sequenceDiagram_SetBudget.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/diagrams/sequenceDiagram_listBudget.png
Binary file not shown.
Binary file removed docs/diagrams/sequenceDiagram_setBudget.jpg
Binary file not shown.

0 comments on commit 50dfc4c

Please sign in to comment.