Skip to content

Commit

Permalink
Merge branch 'master' into developer-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ShyamKrishna33 committed Apr 15, 2024
2 parents 7015dad + f89d86f commit 11197d2
Show file tree
Hide file tree
Showing 29 changed files with 1,759 additions and 141 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ bin/
text-ui-test/EXPECTED-UNIX.TXT
/data/accounts.txt
/data/transactions.txt
/logs/
113 changes: 94 additions & 19 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,24 @@ original source as well}

## Design & implementation

{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.}

### Architecture
The **Architecture Diagram** of BudgetBuddy is shown below. It explains the high-level design of the application.
![](./uml/uml-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.
* `parser` package: consists of the `Parser` class, makes sense of the data input by the user
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.

### [Implemented] Add Account

Expand Down Expand Up @@ -200,23 +217,69 @@ Sequence Diagram
The following sequence diagram illustrates the sequence of interactions involved in the editing of a transaction:
![](./uml/uml-images/processEditTransactionDiagram.png)


### [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
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
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
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.
2. Initialize empty lists for search results and indices.
3. For each transaction in transactions do:
1. Convert transaction description to lowercase (description_lower).
2. Convert transaction amount to string (amount_str).
3. Convert category name to lowercase (category_name).
4. Convert transaction date to string (date_str).
5. If keyword is present in description_lower, amount_str, category_name_lower, or date_str then:
- Add the transaction to the search results list.
- Add the index of the transaction in transactions to the indices list.
4. Display the search results along with their indices to the user.
5. Catch ArrayIndexOutOfBoundsException:
- Print "Invalid search input."
6. Catch Exception:
- Print the exception message.
```

### [Implemented] List Transactions

### Description

The list feature allows users to view their existing transactions. This feature includes viewing all the transactions,
past week's transactions, past month's transactions and transactions from a specified date range.
past week's transactions, past month's transactions, transactions from a specified date range, transactions from a
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 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.
Depending on the list option chosen by the user, different prompts and messages will be output. For options which
require more data by the user, this feature will prompt the user to input the data. Once all required information is
gathered, the method will call on the various methods to build an ArrayList of the desired list and print out the list.
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
required from the user. For the example of custom date transactions, `TransactionList#getCustomDateTransactions` will
call the methods: `UserInterface#getStartDate` and `UserInterface#getEndDate` in order to obtain the desired date range
from the user. Once all the required information is gathered for the particular option, an ArrayList will be created and
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
The following sequence diagram illustrates the sequence of interactions involved in the editing of a transaction:
Expand Down Expand Up @@ -256,28 +319,40 @@ The following is the class diagram for Insights class

## Product scope

### Target user profile
### 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

{Describe the target user profile}

### Value proposition

{Describe the value proposition: what problem does it solve?}
### Value proposition:
* manage daily transactions faster than a typical mouse/GUI driven app

## User Stories

| Version | As a ... | I want to ... | So that I can ... |
|---------|----------|---------------------------|-------------------------------------------------------------|
| v1.0 | new user | see usage instructions | refer to them when I forget how to use the application |
| v2.0 | user | find a to-do item by name | locate a to-do without having to go through the entire list |
| Version | As a ... | I want to ... | So that I can ... |
|---------|----------|----------------------------------------------------|-------------------------------------------------------|
| v1.0 | user | Update my daily expense | Manage my transactions |
| v1.0 | user | Exit from the interface | Stop the application |
| v1.0 | user | Know how to communicate with the bot | Use it effectively |
| v1.0 | user | View my past transactions | Keep track of them |
| v1.0 | user | Delete a transaction | Remove a transaction I added by mistake |
| v1.0 | user | Add income as well as expense transactions | Track my balance |
| v2.0 | user | Keep track of my balance | Know how much money I have left |
| v2.0 | user | Choose the date range to view my transactions | View transactions that I am interested in only |
| v2.0 | user | Track multiple balances such as wallet, debit card | Know how much money I have left in all accounts |
| v2.0 | user | Get a quick view of my past week's transactions | Obtain a quick overview of my recent spending history |
| v2.0 | user | Categorize my transactions | Get insights on each category |

## Non-Functional Requirements

{Give 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.

## Glossary

* *glossary item* - Definition
* **Mainsteam OS**: Windows, Linux, Unix, MacOS

## Instructions for manual testing

Expand Down
37 changes: 37 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ Example of usage:
* `list` followed by `3` to view Past Week Transactions.
* `list` followed by `4` followed by the start date `01-01-2024` followed by the end date `31-03-2024`
to view Custom Date Transactions from 01-01-2024 to 31-03-2024.
* `list` followed by `5` followed by account number `ACCOUNT_NUMBER` to view transactions from that account.
* `list` followed by `6` followed by category number `CATEGORY_NUMBER` to view transactions of that category.

List feature options:
![](./ug/list_options.png)

Successful list feature (custom date) example:
![](./ug/successful_list_feature.png)

### Deleting a transaction: `delete`

Removes a transaction from transaction history.
Expand All @@ -92,6 +97,9 @@ Format: `delete TRANSACTION_ID`
Example of usage:
`delete 1`

Successful delete feature example:
![](./ug/successful_delete_transaction.png)

### Edit a transaction: `edit`

Edits the details of an existing transaction.
Expand All @@ -109,6 +117,34 @@ Example of usage:

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)

### Search for a transaction: `search`

Search for a list of transactions matching the keyword.
Parameters: keyword
Format: `search KEYWORD`

* The `KEYWORD` can be any value representing transaction description, category, transaction amount or
transaction date.
* Search transaction will list out the matching transactions along with their true **index ID**. This can
be used in `edit` or `delete` command.
* Keywords are case-insensitive so
* If there is no matching transactions, the user will be notified.
* This feature will search from the whole transaction history rather than a specific account to ease the
usage of the budgetbuddy.

Example of usage:
`search salary`

Then the user will be asked to edit each information from that specific transaction one by one.

Successful edit feature example:
![](./ug/successful_search.png)



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

Adds a new account with a specified initial balance.
Expand Down Expand Up @@ -185,6 +221,7 @@ the data of your previous BudgetBuddy home folder.
* List transactions `list`
* Delete transaction `delete TRANSACTION_ID`
* Edit transaction `edit TRANSACTION_ID`
* Search transaction `search KEYWORD`
* Add account `add-acc /n/ACCOUNT_NAME /$/INITIAL_BALANCE`
* List accounts `list-acc`
* Delete account `delete-acc ACCOUNT_NUMBER`
Expand Down
18 changes: 14 additions & 4 deletions docs/team/isaaceng7.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ finances. It allows users to track their income and expenses across multiple acc
insights into their financial activities. It is optimized for use via a Command Line Interface (CLI)
and is written in Java, and has about 3 kLoC.

## Summary of Contributions
Given below are my contributions to the project.
* **Code Contributed**: [RepoSense Link](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=isaaceng7&breakdown=true&sort=groupTitle%20dsc&sortWithin=title&since=2024-02-23&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other)
* **List Feature**: Added the ability to view existing transactions.
* What it does: allows users to view their existing transactions.
* Justification: this feature is key to the BudgetBuddy as users need to be aware of their finances through their transactions.
* Highlights: the list feature is enhanced to support viewing transactions that are of a certain duration, a specific account and category.
* **Code Contributed**: [RepoSense Link](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=isaaceng7&breakdown=true&sort=groupTitle%20dsc&sortWithin=title&since=2024-02-23&timeframe=commit&mergegroup=&groupSelect=groupByRepos&checkedFileTypes=docs~functional-code~test-code~other)
* Enhancements: users can choose between 6 different types of list to view:
1. All Transactions
2. Past Week Transactions
3. Past Month Transactions
4. Custom Date Transactions
5. Account Transactions
6. Category Transactions
* **Documentation**:
* User Guide:
* Added documentation for the feature `list`.
* Added documentation for the `list` feature.
* Developer Guide:
* Added implementation details for the feature `list`.
* Added implementation details for the `list` feature.
* Added architecture diagram of BudgetBuddy.
* **Community**:
* Reported bugs and suggestions for other teams in class and PE-D.
61 changes: 60 additions & 1 deletion docs/team/shyamkrishna33.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,75 @@
# Arun Gandhi Shyam Krishna - Project Portfolio Page

## Overview

BudgetBuddy is a desktop financial tracker application that helps users to manage their personal
finances. It allows users to track their income and expenses across multiple accounts and provides
insights into their financial activities. It is optimized for use via a Command Line Interface (CLI)
and is written in Java, and has about 3 kLoC.

## Summary of Contributions

### Code Contributed:
#### [RepoSense Link](https://nus-cs2113-ay2324s2.github.io/tp-dashboard/?search=Shyam&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code~other&since=2024-02-23&tabOpen=true&tabType=authorship&tabAuthor=ShyamKrishna33&tabRepo=AY2324S2-CS2113-T15-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code~other&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false)

### Documentation:

* User Guide:
* Added documentation of feature `add`.
* Added documentation of feature `insights`.
* Developer Guide:
* Added implementation and details of `Category` feature.
* Added implementation and details of processTransaction method with sequence diagram and class diagram.
* Community:
* Reported bugs and suggestions for other teams in class and PE-D.
* Others:
* Added headers for methods in TransactionList, Transaction and DataStorage classes.

### Feature 1 - Adding Transaction

1. Initiated the transaction class with appropriate parameters.
2. Created the `Add` command with the basic arguments to add a transaction to a
list of available transactions.
3. Added JUnit test cases for all the important methods contributing to this feature.
4. Performed exception handling for many types of edge cases with respect to the input arguments.
4. Performed exception handling for many types of edge cases with respect to the input arguments.

**What it does:** Allows users to add a transaction. <br>
**Justification:** This feature is the backbone to the BudgetBuddy as users need to be able to enter a transaction to
use the application.

### Feature 2 - Data Storage

1. Initiated file paths and file format to store the data of the list of transactions.
2. Created `saveTransactions` method to take in an array of transactions, convert the objects into string format
ensuring no
information is lost in the process and writing the data in the specified file paths.
3. Enabled reading of saved data back into an array of transaction objects using the method `readTransactionFile`.
4. Performed exception handling to ensure that in all scenarios the data storage works as intended without any runtime
errors. For example, ensuring that the program does not crash when the files get corrupted due to external
intervention.

**What it does:** Stores all the transactions entered by the user to the database. <br>
**Justification:** This feature is very important as it allows the user to track all the transactions in previous
sessions as it would be meaningless to not have a data storage.

### Feature 3 - Insights

1. Used XChart library to display pie-charts on the available data.
2. Segregated all the available transactions into income and expense type and calculated total amount for each
category in each type. Displayed the proportions of transactions in each category for each type.

**What it does:** Displays 2 pie-charts, one for each type of transaction, which shows the proportion
of each category in all the transactions. <br>
**Justification:** This feature is useful since it allows the user to visualize the distribution of
his/her income/expense among the available categories.

### Exception Handling

* Performed overall exception handling for many peculiar cases like user deleting the storage when program
is running, user entering special characters in command syntax, user force quitting the program etc.
* Also added JUnit test cases for many crucial methods to ensure robustness.

### General Contribution

* Took part regularly in code reviews and team meetings.
* Reviewed around 20 Pull Requests.
24 changes: 24 additions & 0 deletions docs/team/vavinan.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ It is optimized for use via a Command Line Interface (CLI) and is written in Jav
* User Guide:
* Added documentation for the feature `delete`.
* Added documentation for the feature `edit`.
* Added documentation for the feature `search`
* Developer Guide:
* Added implementation details for the feature `delete`.
* Added implementation details for the feature `edit`.
* Added implementation details for the feature `insights`.
* Added implementation details for the feature `search`.

* Community:
* Reported bugs and suggestions for other teams in class and PE-D.

* Others:
* Added headers for UserInterface class and Parser class
### Feature 1 - Deleting Transaction

1. Created the `removeTransaction` method to handle deletion of a transaction based on its index in the list.
Expand Down Expand Up @@ -44,3 +52,19 @@ which has been added with some mistakes and need to be updated. <br>
**Highlights:** Instead of expecting the user to type long command this feature prompts the user to input
value for each data

### Feature 3 - Search Transaction

1. Implemented the `searchTransaction` method to facilitate searching of transactions using a keyword
based on description, date, category or amount.
2. Facilitated by the command `search` followed by the keyword.
3. If the keyword is missing, exception is thrown and the suer will be alerted
4. The keyword is used to search from the list and the matching results will be shows as a table along
with its true **index ID**. If there is no matching transactions, then the user will be notified that there is no matching transactions.

**What it does:** Allows users to search for transactions<br>
**Justification:** this feature is key to the BudgetBuddy as if the transaction is history is too long and
a user wants to delete or edit transaction. Then this search functionality will be helpful as the user can
enter a keyword to search for it to get the true index ID of the transaction. Then that ID can be used in
delete or edit command.


Binary file added docs/ug/successful_delete_transaction.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/ug/successful_edit_transaction.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/ug/successful_list_feature.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/ug/successful_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 11197d2

Please sign in to comment.