-
Notifications
You must be signed in to change notification settings - Fork 231
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
[CS2113-T15-2] BudgetBuddy #46
base: master
Are you sure you want to change the base?
Changes from 250 commits
c975653
3a9920e
693814f
1ae297e
e02c5fa
8af18f7
f298259
1c1b93e
17bae78
cc8570f
71c3c82
9f04522
6820232
3f8f544
70a1129
db104c8
a222239
886bcfb
1966121
d9b01e6
a466baa
961fbc9
17723d2
d537ee2
672065c
0fdcd11
3519839
5c88506
9d2994b
3407736
c371f00
078fbed
4d2fa61
2557351
3d82989
2217af4
86ef423
eaffaad
cf8289d
f485959
a63a23f
7911c51
62cbf18
7310ed8
92d6209
28bafe6
db4356e
fd96336
ef3c58f
e649c85
f0974ac
0f0042d
d7c5725
e1e4b93
d5bd47d
ab733ae
e80f195
a63260a
9b96e86
afcca05
70c05af
4c6cd7c
5249a66
f9c1ce4
c6267a5
0486506
938fc78
84718fc
e3d1a03
10bcf12
a3f3312
c1248ab
44ac6de
e724b0d
92664c6
6023ea2
ab7e09a
ac39076
ec4b238
b5bd383
70a0e08
8d4387d
2108f1e
a7cee9b
d7e562c
d3a5bc5
be08387
312d9c6
e32fd91
0bfdb47
199cd1b
7f19bc0
0e7c0d9
f5f070e
7e82956
eba4354
70a4cfe
1aad93e
ea50a58
30e6312
c62aba9
ac72d66
5da6d9c
4299149
95230bf
f1280fe
e84fa85
a9d1dd7
fb607ed
122523d
5be9d14
dcc2f9c
43b4335
2406ad3
ef65b79
15a57e2
bdaa92b
b2b387f
6a222f3
cc966f0
756af17
a180c5b
248f1a5
13617c2
f48d85a
b11ad9a
02c1781
7db0f38
562a919
18d5475
c1f0de4
b673593
017e5e6
1feda80
ae16ceb
cb7a464
7d6c4cc
b383e62
8dc4a36
f24228c
9cf42e4
a92d121
f1285d5
805592f
e635599
b9ec8ca
4fdcca6
739e3df
a09e1bf
a953341
12556db
f7ab114
203865b
b2804c3
4e53e01
164fa36
8721d4b
1302a31
1443058
f17de2f
e396231
5504724
e2bb3b1
9c04a41
34146e3
7015dad
4da12ba
e32d44f
2ea8daa
0ad93c2
371586d
3ccd4eb
7c232a9
87b3c77
4ad5af8
1e068cf
4063beb
70997ae
25d29f7
11e7c47
1adbcd7
827d799
e47b68a
600cfe9
895fc50
6089b2a
31f2e03
b3a9dc5
c2be51e
d12a134
c6ec752
29021ae
bc24868
a62357e
1f10b97
f934aa1
84210a7
bb43e40
f89d86f
11197d2
310c151
22258de
b9fa417
626d4a0
0f27aa1
c6d4bc8
74254db
221615f
12afb9f
fe78d59
e0284ad
e6d374d
f88360a
a27fd26
9d207cd
c7f8213
4d926b0
e9372d6
8442816
7a127dc
21e2740
5ae96e5
03ff83b
93cc596
b88f4a7
2b7d26e
047b1bd
82ff4b4
fc4eb75
a0c58f2
24ed3f9
d23d441
4464a5b
c3a43fa
1185c53
7565241
1cfe454
a5612f8
d29b8dd
88fc72c
0d3cbcf
da35b9f
6752a8e
ee09909
ecd34eb
f30fe73
47c856b
7b160d2
0b24e22
b8428a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ bin/ | |
|
||
/text-ui-test/ACTUAL.TXT | ||
text-ui-test/EXPECTED-UNIX.TXT | ||
/data/accounts.txt | ||
/data/transactions.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
# About us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
Display | Name | Github Profile | Portfolio | ||
--------|:-------------------------:|:-------------------------------------------:|:---------: | ||
![](./team/images/vaibhav.png) | Vaibhav Dileep Pillai | [Github](https://github.com/vibes-863) | [Portfolio](./team/vaibhavDileepPillai.md) | ||
![](./team/images/Shyam.jpg) | Shyam Krishna Arun Gandhi | [Github](https://github.com/ShyamKrishna33) | [Portfolio](./team/shyamKrishna.md) | ||
![](./team/images/vavinan.jpg) | Jeevanandham Vavinan | [Github](https://github.com/Vavinan) | [Portfolio](./team/jeevanandhamVavinan.md) | ||
![](./team/images/isaac.jpg) | Isaac Eng | [Github](https://github.com/isaaceng7) | [Portfolio](./team/isaacEng.md) |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very concise and well explained information shown in the Developer Guide |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,219 @@ | |
|
||
## Acknowledgements | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the | ||
original source as well} | ||
|
||
## Design & implementation | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
|
||
### [Implemented] Add Account | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a reason why [Implemented] was used for already implemented features instead of [Pending] for un-implemented features like in the course website? |
||
|
||
#### Description | ||
|
||
This method is used to add a new account to the list of accounts based on the user input provided. The input should | ||
include the account name and initial balance. After the account is successfully added, the account balance is | ||
initialized with the provided initial balance, and a unique account number is generated and assigned to the account. A | ||
message is displayed to the user indicating the success of the operation. This allows users to manage multiple accounts | ||
by adding new ones as needed. | ||
|
||
#### Parameters | ||
|
||
1. String input: A string containing the user input, which should include the account name and initial balance, | ||
separated by specific delimiters. | ||
|
||
#### Design and Implementation | ||
|
||
The method starts by validating the syntax of the user input to ensure it contains the necessary delimiters for the | ||
account name and initial balance. If the input does not meet the expected format, it throws an | ||
InvalidArgumentSyntaxException. It then parses the input to extract the account name and initial balance. If either the | ||
name or initial balance is missing or empty, an EmptyArgumentException is thrown. Additionally, if the initial balance | ||
is not a valid double value, a NumberFormatException is thrown. | ||
|
||
After successfully parsing and validating the input, the method proceeds to generate a unique account number for the new | ||
account. It ensures that the generated number is not already in use by any existing account. Once a unique number is | ||
obtained, a new Account object is created with the generated account number, provided account name, and initial balance. | ||
This new account is then added to the list of accounts, and its number is added to the list of existing account numbers | ||
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 sequence diagram shows how the add account process works: | ||
|
||
![](./uml/uml-images/addAccountDiagram.png) | ||
|
||
### [Implemented] Category feature | ||
|
||
#### Description | ||
|
||
The Category feature empowers users to effectively categorize transactions based on their preferences. When initiating a | ||
new transaction through the `Add` command, users are prompted to select a category from a predefined list. This ensures | ||
organized and streamlined transaction management. | ||
|
||
#### Design and Implementation | ||
|
||
The implementation of the Category feature revolves around the integration of a `category` attribute within each | ||
transaction object. This attribute is defined as a member of the `Category` enum class. | ||
|
||
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. | ||
|
||
### [Implemented] Process transaction | ||
|
||
#### Description | ||
|
||
This method adds a transaction to the list of transactions based on the necessary input details given by the user. | ||
|
||
#### Parameters | ||
|
||
1. String input: A string containing the user input, which should include the `NAME`, `AMOUNT`, `DATE` and `TYPE` of the | ||
transaction. | ||
2. Account account: The account object associated with the transaction list. | ||
|
||
#### Design and Implementation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Examples and expected outcomes could be used for clarity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be clearer if we utilize more |
||
|
||
1. ##### Syntax Validation: | ||
|
||
The method first checks whether the input string contains all necessary arguments ("/a/", "/t/", "/n/", "/$/", "/d/") | ||
required for adding a transaction. If any argument is missing, it throws an InvalidAddTransactionSyntax exception. | ||
Comment on lines
+159
to
+160
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. readability would really improve here with |
||
|
||
2. #### Transaction Parsing: | ||
|
||
It utilizes a parser object to parse the user input string into a Transaction object using the | ||
parseUserInputToTransaction method. | ||
|
||
3. #### Assertion Checks: | ||
|
||
Assertions are used for debugging purposes to ensure that the parsed transaction and added transaction are not null. | ||
If they are null, assertion errors are thrown. | ||
|
||
4. #### Category Assignment: | ||
|
||
If the category of the transaction is null, it prompts the user to choose a category from a list and assigns the | ||
chosen category to the transaction. | ||
|
||
5. #### Transaction Addition: | ||
|
||
After parsing and category assignment, the transaction is added to the account using the addTransaction method. | ||
|
||
6. #### Feedback to User: | ||
|
||
Upon successful addition of the transaction, a message is printed to the user indicating the details of the added | ||
transaction and the updated account balance. | ||
|
||
#### Exceptions: | ||
|
||
Comment on lines
+186
to
+187
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clear diagram here. Would be good if we can highlight some exceptions here since this is in the Exceptions section, or should it be in another section? |
||
1. `InvalidTransactionTypeException`: This exception is thrown when the transaction type is not one of `income` | ||
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 sequence diagram shows how a remove transaction goes works: | ||
|
||
![](./uml/uml-images/addTransactionDiagram.png) | ||
|
||
### [Implemented] Remove transaction | ||
|
||
#### Description | ||
|
||
This method is used to remove a transaction from the list of transactions based on the transaction ID provided | ||
by the user. After the transaction is removed, the account balance is updated accordingly and a message is | ||
displayed to the user indicating the success of the operation. This helps user to remove the transaction | ||
from the list they added by mistake or those transactions they no longer need to keep track off. | ||
|
||
#### Parameters | ||
|
||
1. String input: A string containing the user input, which should include the transaction ID to be removed. | ||
2. Account account: The account object associated with the transaction list. | ||
|
||
#### Design and Implementation | ||
|
||
The method first validates the user input to ensure it's not empty or null. If the input is invalid, it throws | ||
an EmptyArgumentException. Next, it extracts the transaction ID from the input and verifies its integrity as a | ||
valid integer. If the ID is invalid, a NumberFormatException is thrown. | ||
|
||
Once a valid transaction ID is obtained, the method calculates its corresponding index in the transactions | ||
ArrayList by subtracting 1 from the provided ID, as ArrayList indices start from 0 . It then verifies | ||
if the calculated index falls within the bounds of the ArrayList. If the index is out of bounds, an | ||
InvalidIndexException is thrown. | ||
|
||
Upon successful validation, the method removes the transaction at the calculated index from the transactions | ||
ArrayList. Subsequently, it updates the account balance to reflect the removed transaction. Finally, it | ||
notifies the user of the successful removal along with displaying the details of the removed transaction. | ||
|
||
The following sequence diagram shows how a remove transaction goes works: | ||
|
||
![](./uml/uml-images/removeTransactionDiagram.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sequence diagram looks good, quite detailed. |
||
|
||
### [Implemented] Edit Transaction | ||
|
||
#### Description | ||
|
||
This method facilitates the editing of a transaction within the list of transactions associated with a | ||
specific account. Users can edit transactions by providing the index of the transaction they wish to modify | ||
along with the updated transaction details. After the edit operation is completed, the system updates the | ||
transaction accordingly and notifies the user of the successful operation. This feature enhances user | ||
flexibility by allowing them to correct erroneous transactions or update transaction details as needed. | ||
|
||
#### Parameters | ||
|
||
1. String input: A string representing user input, including the index of the transaction to be edited and | ||
the updated transaction details. | ||
2. Account account: The account object associated with the transaction list. | ||
|
||
#### Design and Implementation | ||
|
||
The processEditTransaction method follows a structured approach to ensure the successful editing of | ||
transactions while maintaining data integrity: | ||
|
||
1. Input Validation: The method begins by validating the user input to ensure it is not empty or null. If | ||
the input is invalid, an EmptyArgumentException is thrown to prompt the user to provide valid input. | ||
2. Transaction Index Extraction: After validating the input, the method extracts the index of the | ||
transaction to be edited from the input string. It ensures the extracted data is a valid integer; otherwise, a | ||
NumberFormatException is thrown to indicate invalid input. | ||
3. Index Calculation: Once a valid transaction index is obtained, the method calculates the corresponding | ||
index in the transactions ArrayList. As ArrayList indices start from 0, the provided index is decremented | ||
by 1 to align with the ArrayList index. | ||
4. Index Bounds Verification: The method verifies whether the calculated index falls within the bounds of | ||
the transactions ArrayList. If the index is out of bounds, an InvalidIndexException is thrown to notify the user of | ||
the invalid index provided. | ||
5. Transaction Editing: Upon successful validation, the method retrieves the transaction object at the | ||
calculated index from the transactions ArrayList. It prompts the user to input the updated transaction details | ||
through the UserInterface.getEditInformation() method. The edited transaction is then parsed using the | ||
parser.parseTransactionType() method to ensure its validity and association with the provided account. Finally, the | ||
edited transaction replaces the original transaction at the specified index in the transactions ArrayList using the | ||
transactions.set() method. | ||
6. User Notification: After editing the transaction, the method notifies the user of the successful | ||
operation by displaying a message through the UserInterface.printUpdatedTransaction() method. | ||
|
||
Sequence Diagram | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. formatting here is abit w0nky |
||
The following sequence diagram illustrates the sequence of interactions involved in the editing of a transaction: | ||
![](./uml/uml-images/processEditTransactionDiagram.png) | ||
|
||
### [Implemented] List feature | ||
|
||
### 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. | ||
|
||
#### Implementation | ||
|
||
This feature is facilitated through the `TransactionList#processList`, where it prompts the user for their choice of | ||
list they wish to see. After the user inputs the choice, the get functions will store the transactions in a new | ||
ArrayList and `UserInterface#printPastTransactions` will handle the output of the list. | ||
|
||
Sequence Diagram | ||
The following sequence diagram illustrates the sequence of interactions involved in the editing of a transaction: | ||
![](./uml/uml-images/processList.png) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the clear and informative diagram! |
||
|
||
## Product scope | ||
|
||
### Target user profile | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Target user profile and the Users Stories should be included for to give us a better understanding of this app. |
||
{Describe the target user profile} | ||
|
@@ -20,10 +225,10 @@ | |
|
||
## User Stories | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The user stories should be expanded upon, as there are clearly a variety of uses for this application. |
||
|
||
|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 | 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 | | ||
|
||
## Non-Functional Requirements | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If content is empty, would be best to remove the skeleton code. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Duke | ||
# BudgetBuddy | ||
|
||
{Give product intro here} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be improved with the addition of diagrams to complement the content written