Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dg #180

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/AboutUs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Display | Name | Github Profile | Portfolio
--------|:-------------------------:|:-------------------------------------------:|:---------:
![](./team/images/vaibhav.png) | Vaibhav Dileep Pillai | [Github](https://github.com/vibes-863) | [Portfolio](./team/vibes-863)
![](./team/images/Shyam.jpg) | Shyam Krishna Arun Gandhi | [Github](https://github.com/ShyamKrishna33) | [Portfolio](./team/shyamkrishna33)
![](./team/images/vavinan.jpg) | Jeevanandham Vavinan | [Github](https://github.com/Vavinan) | [Portfolio](./team/vavinan)
![](./team/images/isaac.jpg) | Isaac Eng | [Github](https://github.com/isaaceng7) | [Portfolio](./team/isaaceng7)
![](images/vaibhav.png) | Vaibhav Dileep Pillai | [Github](https://github.com/vibes-863) | [Portfolio](./team/vibes-863)
![](images/Shyam.jpg) | Shyam Krishna Arun Gandhi | [Github](https://github.com/ShyamKrishna33) | [Portfolio](./team/shyamkrishna33)
![](images/vavinan.jpg) | Jeevanandham Vavinan | [Github](https://github.com/Vavinan) | [Portfolio](./team/vavinan)
![](images/isaac.jpg) | Isaac Eng | [Github](https://github.com/isaaceng7) | [Portfolio](./team/isaaceng7)

131 changes: 87 additions & 44 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ original source as well}

## Design & implementation


### Architecture
The **Architecture Diagram** of BudgetBuddy is shown below. It explains the high-level design of the application.
![](./uml/uml-images/architectureDiagram.png)

The **Architecture Diagram** of BudgetBuddy is shown below. It explains the high-level design of the application. <br>
![](images/architectureDiagram.png)

**Main components of the architecture:**

The bulk of BudgetBuddy work is done by these following four components:

* `BudgetBuddy` class: is the main class of the application, in charge of the app launch,
shut down and reading user's inputs. It invokes the loading and saving of data when the app is launched/shut down.
* `ui` package: consists of `Ui` class, which deals with all the printing/output to the user,
and also some reading of user's inputs for additional data.
shut down and reading user's inputs. It invokes the loading and saving of data when the app is launched/shut down.
* `ui` package: consists of `Ui` class, which deals with all the printing/output to the user,
and also some reading of user's inputs for additional data.
* `parser` package: consists of the `Parser` class, makes sense of the data input by the user
to provide meaningful data for other methods.
to provide meaningful data for other methods.
* `storage` package: consists of `DataStorage` class, in charge of saving and loading of the `data` files.

These components help to manipulate the `Transaction`, `TransactionList`, `Account` and `AccountManager` classes
which drives BudgetBuddy.
which drives BudgetBuddy. <br> <br>

### [Implemented] Add Account

Expand Down Expand Up @@ -58,9 +59,49 @@ to ensure uniqueness.
Finally, the method notifies the user of the successful addition of the account by displaying the details of the newly
created account.

The following class diagram shows the associations between classes involved in adding an account.

![](images/AddAccountClassDiagram.png)

The following sequence diagram shows how the add account process works:

![](./uml/uml-images/addAccountDiagram.png)
![](images/addAccountDiagram.png)<br> <br>

### [Implemented] Remove Account

#### Description

This method is used to remove an existing account from the system based on the account number provided by the user
input. It checks for the existence of the account in the system, and if found, it removes the account and any associated
transactions, displaying a message indicating successful removal. This allows users to manage their accounts effectively
by removing unnecessary or outdated accounts.

#### Parameters

1. String input: A string containing the user input, which should include the account number to be removed, parsed using
specific delimiters.

#### Design and Implementation

The method begins by validating the presence of the account number in the user input. If the format is incorrect, it
throws an `InvalidArgumentSyntaxException`. If the account number is missing or the format is incorrect (not a valid
integer), a `NumberFormatException` or `EmptyArgumentException` is thrown.

After validating and parsing the account number, it checks if removing the account would result in no accounts left,
which is not allowed. If valid, it proceeds to remove the account by the account number. It also removes any associated
transactions with this account from the transaction list, ensuring no orphan transactions remain.

Finally, the method updates the system's account list and transaction list to reflect the removal and notifies the user
of the successful operation by displaying relevant details of the removed account and transactions.

The following sequence diagram shows how the remove account process works:

![](images/RemoveAccounrSequenceDiagram.png)

**Additional Notes**
The method ensures that the system's integrity is maintained by not allowing the last account to be removed, which is
handled gracefully with appropriate user notifications. The removal process also involves updating various components of
the system to reflect the changes accurately.<br> <br>

### [Implemented] Category feature

Expand All @@ -77,7 +118,7 @@ transaction object. This attribute is defined as a member of the `Category` enum

Upon invoking the `Add` command, users are presented with a selection prompt featuring the available categories. User
input, typically in the form of a numerical identifier corresponding to a category within the enum class, facilitates
the assignment of the appropriate enum object to the transaction's category attribute.
the assignment of the appropriate enum object to the transaction's category attribute.<br> <br>

### [Implemented] Process transaction

Expand Down Expand Up @@ -125,19 +166,19 @@ This method adds a transaction to the list of transactions based on the necessar
#### Exceptions:

1. `InvalidTransactionTypeException`: This exception is thrown when the transaction type is not one of `income`
and `expense`.
and `expense`.

2. `InvalidAddTransactionSyntax`: This exception is thrown when the syntax of the add transaction is invalid.

3. `EmptyArgumentException`: This exception is thrown when an empty argument is encountered.

The following class diagram shows the associations between classes involved in processing a transaction.

![](./uml/uml-images/TransactionListDiagram.png)
![](images/TransactionListDiagram.png)

The following sequence diagram shows how an add transaction command works:

![](./uml/uml-images/addTransactionDiagram.png)
![](images/addTransactionDiagram.png)<br> <br>

### [Implemented] Remove transaction

Expand Down Expand Up @@ -170,7 +211,7 @@ notifies the user of the successful removal along with displaying the details of

The following sequence diagram shows how a remove transaction goes works:

![](./uml/uml-images/removeTransactionDiagram.png)
![](images/removeTransactionDiagram.png)<br> <br>

### [Implemented] Edit Transaction

Expand Down Expand Up @@ -215,30 +256,32 @@ transactions while maintaining data integrity:

Sequence Diagram
The following sequence diagram illustrates the sequence of interactions involved in the editing of a transaction:
![](./uml/uml-images/processEditTransactionDiagram.png)

![](images/processEditTransactionDiagram.png)<br> <br>

### [Implemented] Search Transactions

### Description

This method enables users to search for transactions based on a keyword. Users provide a keyword, and the system
searches through transaction descriptions, amounts, categories, and dates to find matches. The search results,
along with their corresponding indices in the transactions list, are displayed to the user.

#### Design and Implementation

1. **Keyword Extraction:** The method extracts the keyword from the user input.

2. **Search Process:** It iterates through the list of transactions, checking if any transaction's
description, amount, category, or date contains the keyword. Matches are added to a list of search
2. **Search Process:** It iterates through the list of transactions, checking if any transaction's
description, amount, category, or date contains the keyword. Matches are added to a list of search
results along with their corresponding indices in the transactions list.

3. **Output Generation:** Once the search process is completed, the method generates output by displaying the
3. **Output Generation:** Once the search process is completed, the method generates output by displaying the
search results along with their indices to the user.

4. **Exception Handling:** The method handles exceptions such as an empty keyword input or any unexpected
4. **Exception Handling:** The method handles exceptions such as an empty keyword input or any unexpected
errors during the search process. Proper error messages are displayed to the user in case of exceptions.

Example Algorithm:

```
searchTransactions(input)
1. Extract the keyword from the user input.
Expand All @@ -256,8 +299,8 @@ searchTransactions(input)
- Print "Invalid search input."
6. Catch Exception:
- Print the exception message.
```

```
### [Implemented] List Transactions

### Description
Expand All @@ -268,10 +311,10 @@ specified account and transactions of a particular category.

#### Design and Implementation

This feature is facilitated through the `TransactionList#processList`, and it is designed to ensure successful viewing
of the desired list as inputs are required in a bite-sized manner.
This feature is facilitated through the `TransactionList#processList`, and it is designed to ensure successful viewing
of the desired list as inputs are required in a bite-sized manner.

This method first executes the `UserInterface#printListOptions` to show users the list options and their indexes which
This method first executes the `UserInterface#printListOptions` to show users the list options and their indexes which
is needed for their inputs. The method will throw an InvalidIndexException if the input is out of the range (range 1-6).
Depending on the list option chosen by the user, the case statement of the `TransactionList#processList` will run, and
execute the method of the corresponding option. Different methods would have different prompts as more information is
Expand All @@ -281,52 +324,51 @@ from the user. Once all the required information is gathered for the particular
the desired transactions will be added into that ArrayList. Then, this ArrayList will be printed out, displaying the
transactions of the chosen option.

Sequence Diagram
Sequence Diagram <br>
The following sequence diagram illustrates the sequence of interactions involved in the editing of a transaction:
![](./uml/uml-images/processList.png)

![](images/processList.png)<br> <br>

### [Implemented] Insights

#### Description

This feature provides insights into the categorized expenses and incomes of the user. It utilizes the Insight
class to calculate and display pie charts representing the distribution of expenses and incomes across
class to calculate and display pie charts representing the distribution of expenses and incomes across
different categories. <br>

#### Design and Implementation

1. The displayCategoryInsight method iterates through the list of transactions and calculates the total income
and expense amounts for each category. It then calls the displayPieChart method to visualize these insights
using pie charts.
and expense amounts for each category. It then calls the displayPieChart method to visualize these insights
using pie charts.

2. The displayPieChart method creates separate pie charts for income and expense categories using the XChart
library. It customizes the appearance of the charts and adds series for each category with their respective
income or expense amounts.
2. The displayPieChart method creates separate pie charts for income and expense categories using the XChart
library. It customizes the appearance of the charts and adds series for each category with their respective
income or expense amounts.

3. The indexOf method is a private helper function used to find the index of a specific category within an
array
of categories.
3. The indexOf method is a private helper function used to find the index of a specific category within an
array
of categories.

4. The closeInsightFrames method is responsible for closing any open frames related to insights, specifically
targeting frames related to income and expense insights to ensure proper cleanup and resource management.
4. The closeInsightFrames method is responsible for closing any open frames related to insights, specifically
targeting frames related to income and expense insights to ensure proper cleanup and resource management.

The following is the class diagram for Insights class

![](./uml/uml-images/insightDiagram.png)


![](images/insightDiagram.png)

## Product scope

### Target user profile:

* has a need to manage significant number of day-to-day transactions
* prefer desktop apps over other types
* can type fast
* prefers typing to mouse interactions
* is reasonably comfortable using CLI apps

### Value proposition:

* manage daily transactions faster than a typical mouse/GUI driven app

## User Stories
Expand All @@ -346,13 +388,14 @@ The following is the class diagram for Insights class
| v2.0 | user | Categorize my transactions | Get insights on each category |

## Non-Functional Requirements

1. Should work on any *mainstream OS* as long as it has Java `11` or above installed.
2. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be
able to accomplish most of the tasks faster using commands than using the mouse.
able to accomplish most of the tasks faster using commands than using the mouse.

## Glossary

* **Mainsteam OS**: Windows, Linux, Unix, MacOS
* **Mainstream OS**: Windows, Linux, Unix, macOS

## Instructions for manual testing

Expand Down
20 changes: 10 additions & 10 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Adds a transaction into the transaction list of the specified account.
* `add /n/New iPhone /$/2000 /c/9 /t/Expense /a/5431 /d/20-03-2024`

_Successful add feature output:_ <br>
![](./ug/successful_add_feature.png)<br> <br>
![](images/successful_add_feature.png)<br> <br>

### View transaction history: `list`

Expand All @@ -91,10 +91,10 @@ List the existing transactions. List feature includes options:
* `list` followed by `6` followed by category number `CATEGORY_NUMBER` to view transactions of that category.

_List feature options:_ <br>
![](./ug/list_options.png)
![](images/list_options.png)

_Successful list feature (custom date) example:_ <br>
![](./ug/successful_list_feature.png)<br> <br>
![](images/successful_list_feature.png)<br> <br>

### Deleting a transaction: `delete`

Expand All @@ -114,7 +114,7 @@ Removes a transaction from transaction history.
`delete 1`

_Successful delete feature example:_
![](./ug/successful_delete_transaction.png)<br> <br>
![](images/successful_delete_transaction.png)<br> <br>

### Edit a transaction: `edit`

Expand All @@ -138,7 +138,7 @@ Edits the details of an existing transaction.
* Then the user will be asked to edit each information from that specific transaction one by one.

_Successful edit feature example:_
![](./ug/successful_edit_transaction.png)<br> <br>
![](images/successful_edit_transaction.png)<br> <br>

### Search for a transaction: `search`

Expand All @@ -164,7 +164,7 @@ Search for a list of transactions matching the keyword.
* Then the user will be asked to edit each information from that specific transaction one by one.

_Successful edit feature example:_ <br>
![](./ug/successful_search.png)<br> <br>
![](images/successful_search.png)<br> <br>

### Add an account: `add-acc`

Expand All @@ -182,7 +182,7 @@ Adds a new account with a specified initial balance.
`add-acc /n/DBS Savings /$/10000`

_Successful add-acc feature output:_ <br>
![](./ug/successful_add_acc_feature.png)<br> <br>
![](images/successful_add_acc_feature.png)<br> <br>

### List all accounts: `list-acc`

Expand All @@ -191,7 +191,7 @@ List all the existing accounts.
**Format:** `list-acc`

_Successful list-acc feature output: <br>_
![](./ug/successful_list_acc_feature.png)<br> <br>
![](images/successful_list_acc_feature.png)<br> <br>

### Delete an account: `delete-acc`

Expand All @@ -209,7 +209,7 @@ Removes an account and removes all its transactions.
`delete-acc 5431`

_Successful delete-acc feature output:_ <br>
![](./ug/successful_delete_acc_feature.png)<br> <br>
![](images/successful_delete_acc_feature.png)<br> <br>

### Edit an account: `edit-acc`

Expand All @@ -227,7 +227,7 @@ Edits the details of an existing account.
`edit-acc 5431`

_Successful edit-acc feature output:_ <br>
![](./ug/successful_edit_acc_feature.png)<br> <br>
![](images/successful_edit_acc_feature.png)<br> <br>

### View transaction insights: `insights`

Expand Down
Loading
Loading