-
Notifications
You must be signed in to change notification settings - Fork 140
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-W14-1] W14G1 (WIAGI) #21
base: master
Are you sure you want to change the base?
Changes from 250 commits
3a636a1
7547ce0
244502b
c90a10e
0d6aae0
9cdef0c
a241e93
b9a95fc
d4a8369
025d207
e26e229
601e9f4
751f770
ca9b6d9
6c27ddc
b0984c6
a0af2c5
5fce723
7b967a6
9aed966
c0f8697
dad1f83
d122d15
4485382
0e08e3b
c5c99a2
a504bac
ffec130
93241bd
5dc596d
5d4a8f7
cfdd32c
b2a994a
bfc009c
0017db2
cd5cd0d
d1c73bb
f556cb9
d0d6712
c072905
fc6d33b
e8c24ca
5ce0f6e
4dbb817
f417dbc
c8b6ffe
fff2eb3
b745deb
814b51d
f778c76
945dd24
53ec95d
b95a168
2015164
86d06b0
ea75463
33c9ce9
5022f2f
c7d5320
baf911a
143edcc
406b80f
18bf35c
e88ed21
d27accc
7cc3ddc
8695ff1
b474d8b
8388dce
2f8dce3
91a6e84
6ed2479
9382c41
6337c19
c2bdbf4
94e7b95
52b7d2b
4bd8fba
4eb67f2
16bf270
5d851d2
83327b2
37e670a
9606949
be445d9
be9e128
751e1b6
8e78f98
2a3fd90
25018f5
64e4116
bf1d734
7ac92fe
d6657c1
3817d1a
bdfbc3c
7168646
61355eb
38dc97b
ed922b0
b553f15
0663eea
c0c142a
fa93069
337a8ac
8cd5484
57147fc
253e509
4c1843d
dac18f3
9c1955e
1c2714a
bfdfe18
4bc8f31
93aa63d
28530e5
d4b9e92
aabc98e
029b920
35ffd4a
e513e89
4b8ae11
77c89be
8aa8259
24a2637
c7ecdeb
4afb7d2
ac2293b
75dd1f7
e322d23
e6dadff
a9b861f
f77b251
17ade99
ed3583f
52d3ebb
4ecebbe
fe30713
248203b
9872370
960c983
6f27ea8
9e53ddc
4c8ee2b
2298d5e
989496e
3d8b622
1cb0f72
c2a7dfa
76a317e
ac75ff2
2f18f65
0e02dbd
485ec80
7101481
7e8d666
b29d15e
7a80a36
65a4ee0
3266931
6ee9821
51fd2ae
00b8158
d2a5073
514966e
60ecb9a
d6d6ca7
702f337
51c5965
e73b677
4e04b89
ef2dca1
f324daa
d306936
2def452
5cc5367
4d419bf
eabb3eb
753c622
ac5e507
63f55c8
fad80d5
cb3c706
af8a6c2
642636e
5af5fdd
ed82689
8a7511e
8a12d03
fc01384
1cee0d8
6293e03
6fe1ae5
b0cb528
7846965
443e712
afe667d
7b17b9b
12d6fc0
d9b8552
2211f4b
07e9abd
3fc9634
aa9e074
eee0586
9e5ebd7
9e733cb
698270f
987c81a
66f5efc
11e0a99
cef609c
729057f
171fbd7
e735f47
f7ec16e
5cc495f
97bf2b8
6a8df00
b9d68ee
a60d54c
0249e40
66b89da
ed102c9
20296aa
85c3c61
be86582
735eca2
d8f2554
474956a
878412f
b00d87b
e9a90df
b7db6db
df431ef
f4d5c4a
370deb0
2789718
81bcbaa
4bf1f16
6927a71
fe326da
da75a41
6756bea
9157ae2
0fb57f9
f853eab
56166eb
43a22a9
0052e4a
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# 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) | ||
Name | Github Profile | Portfolio | ||
------------:|:---------------------------------------:|:---------: | ||
Weng Hong | [Github](https://github.com/wongwh2002) | [Portfolio](docs/team/weng.md) | ||
Nigel Yeo | [Github](https://github.com/NigelYeoTW) | [Portfolio](docs/team/NigelYeo.md) | ||
Wen Xi | [Github](https://github.com/wx-03) | [Portfolio](docs/team/wenxi.md) | ||
Ryan Harwood | [Github](https://github.com/rharwo) | [Portfolio](docs/team/ryanharwood.md) | ||
Tan Ping Hui | [Github](https://github.com/TPH777) | [Portfolio](docs/team/tanpinghui.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,153 @@ | |
|
||
## 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} | ||
|
||
[Original Source](https://github.com/nus-cs2113-AY2425S1/tp) | ||
|
||
## Design & implementation | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
|
||
## Overall Class Diagram | ||
![overallClass.jpg](./Diagrams/overallClass.jpg) | ||
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. Great strategy to leave out the irrelevant classes for a high level overview 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 think since you are already omitting other classes for conciseness, i dont think its necessary and easier to read to include simple getter functions in the classes that you show here. 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. especially since this is to show the overall architecture this can be quite trivial 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. |
||
On a high level, whenever Wiagi is started, it will load SpendingList and IncomeList from Storage if it exists, else, | ||
new lists would be created | ||
Wiagi then takes in user input via the UI class, then parse and executes the command through the parser class. | ||
The related output is printed through the UI class. | ||
At the end of the run, or when the user exits the application, Wiagi will save the lists. | ||
|
||
### Storage | ||
To load data from previous session: | ||
Within Wiagi constructor, Storage class is constructed, which will load and initialise incomes, spendings and | ||
password by de-serialising the text at their distinct file paths. Wiagi will then initialise it incomes and spendings | ||
based on the member in the Storage class. | ||
![storageLoad.png](./Diagrams/storageLoad.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. Will the unnamed instances of IncomeListStorage etc. be ready for garbage collection after the load is finished? If not, maybe add a comment on how they will be reused later. 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. There's a ref for login but there is no sd 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. |
||
|
||
To save data for current session: | ||
After the command bye is sent by the user, incomes and spendings will be serialised and overwrite texts in | ||
their distinct file paths. | ||
![storageSave.png](./Diagrams/storageSave.png) | ||
|
||
### adding of new entry | ||
![addCommandSequence.jpg](./Diagrams/addCommandSequence.jpg) | ||
To add new entries, user will have to input the related commands. | ||
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. |
||
Wiagi will then parse the command to the AddCommand class. | ||
The AddCommand class will then validate the user's input and add the input to IncomeList or SpendingList | ||
|
||
### deleting of entry, editing of entry | ||
The commands are similar where there would be a parsing of command to each of its individual classes. | ||
A similar validation process takes place and actions would be made on IncomeList or SpendingList accordingly | ||
(deleting entry from list for delete and editing of entry from list for edit) | ||
|
||
### Recurrence Component | ||
|
||
#### Motivation behind the component:</br> | ||
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 |
||
+ Allows the user to set specific expenditure and incomes as recurring events to increase efficiency when using the | ||
application | ||
+ Users may have differing frequencies for recurring events thus application gives them a few common options | ||
|
||
Illustrated below is the class diagram for the Recurrence Component:</br> | ||
</br> | ||
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 |
||
<img src="./Diagrams/recurrenceClassDiagram.png" alt="recurrenceClassDiagram" width="800"/> | ||
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. 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. Partly hard to reed the methods and attributes. 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. 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. 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. This diagram is really quite hard to read, especially with all the long and similar function names for daily monthly and yearly recurrence, maybe there are other ways you can display this nicer. or maybe split it up 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. |
||
</br> | ||
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. |
||
</br> | ||
Illustrated below is the sequence diagram of the Recurrence Component: </br> | ||
</br> | ||
<img src="./Diagrams/recurrenceSequenceDiagram.png" alt="recurrenceSequenceDiagram" width="700"/> | ||
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. |
||
</br> | ||
For the reference fragment of 'load from storage', refer to [Storage component](#storage). </br> | ||
For the reference fragment of 'add recurring entry', refer to | ||
[checkIncomeRecurrence / checkSpendingRecurrence](#checkincomerecurrence--checkspendingrecurrence-method) method. </br> | ||
|
||
|
||
#### How the Recurrence Component works:</br> | ||
+ Upon running the application by the user, `Storage` component will load the `IncomeList` and `SpendingList` members of | ||
`Wiagi` to retrieve past data. | ||
+ Both list are then iterated through. Each member of the list is parsed through `Parser` which returns the type of | ||
recurrence it is (eg. `DailyRecurrence`, `null`) which is encapsulated as a `Recurrence` object. | ||
+ If `Recurrence` is not `null` (ie. a recurring entry), it checks the entry and adds to the `SpendingList` and | ||
`IncomeList` if needed. </br> | ||
|
||
#### Implementation: | ||
#### Recurrence class | ||
The `Recurrence` class is a abstract class that provides the interface for checking `Income` and `Spending` and adding | ||
recurring entries into the list. </br> | ||
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 following are the abstract methods defined: </br> | ||
+ `checkSpendingRecurrence` | ||
+ `checkIncomeRecurrence` | ||
|
||
The following are child classes of `Recurrence`: | ||
+ `DailyRecurrence`: Handles entries labelled as daily recurring events | ||
+ `MonthlyRecurrence`: Handles entries labelled as monthly recurring events | ||
+ `YearlyRecurrence`: Handles entries labelled as yearly recurring events | ||
|
||
##### parseRecurrence method | ||
Class: `Parser` </br> | ||
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. What do you mean here? Is it part of the Parser class? Why then is it located under the implementation of the Recurrence class? Potentially you could help the reader understand the structure a bit more but not only relying on your class diagrams and sequence diagrams, but also by giving you test more structure. 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 guess what you want to say with the 'class' label is in which classes it is used. Simply change the naming then to make this more clear. |
||
Method Signature: </br> | ||
``` | ||
public static Recurrence parseRecurrence(Type entry) | ||
``` | ||
Functionality: </br> | ||
1. Takes in child class of `Type` (ie. `Spending`, `Income`) | ||
2. Matches the `reccurenceFrequency` attribute with switch case to determine which `Recurrence` child to return | ||
3. Returns `DaillyRecurrence`, `MonthlyRecurrence`, `YearlyRecurrence` or `null`(If not a recurring entry). | ||
|
||
##### checkIncomeRecurrence / checkSpendingRecurrence method | ||
Class: `DailyRecurrence`, `MonthlyRecurrence`, `YearlyRecurrence` </br> | ||
Method Signature: </br> | ||
``` | ||
@Override | ||
public void checkIncomeRecurrence(Income recurringIncome, IncomeList incomes) | ||
@Override | ||
public void checkSpendingRecurrence(Spending recurringSpending, SpendingList spendings) | ||
``` | ||
Below illustrates the functionality of the checkIncomeRecurrence method through a sequence diagram </br> | ||
</br> | ||
<img src="./Diagrams/addRecurrenceEntry.png" alt="addRecurrenceEntry" width="700"/> </br> | ||
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. 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 that you used a note to explain CheckDate. |
||
Note that recurrence frequency is either 1 day (daily), 1 month (monthly) or 1 year (yearly). </br> | ||
Since checkSpendingRecurrence method follows the same sequence as checkIncomeRecurrence method, the diagram is omitted | ||
for brevity. | ||
|
||
Functionality: </br> | ||
1. Checks `lastRecurred` attribute of `recurringIncome`/`recurringSpending` against the current date via `LocalDate.now` | ||
2. According to the type of recurrence, check if enough time has passed between the 2 dates | ||
3. Adds additional recurring entries into the `IncomeList`/`SpendingList` if needed. | ||
|
||
##### updateRecurrence method | ||
Class: `SpendingList`, `IncomeList` </br> | ||
Method Signature: | ||
``` | ||
public static Recurrence parseRecurrence(Type entry) | ||
``` | ||
Functionality: </br> | ||
1. Loops through its list and calls upon `Parser#parseRecurrence` to determine type of `Recurrence` | ||
2. Calls upon `Recurrence#checkSpendingRecurrence` or `Recurrence#checkIncomeRecurrence` to update list if the new | ||
recurring entry is supposed to be added | ||
|
||
#### Here are some things to take note: | ||
+ Entries are only added when user logs in, which is not determinable, thus many additional entries may be added at once | ||
(eg. user last logged in 4 days ago with one daily recurring entry in the list. When the user logs in, 4 days of entries | ||
will be backlogged and added). List is thus also sorted by date after recurrence is done. | ||
+ Additional entries added by `Recurrence` are being set to not recurring events to prevent double recurring entries | ||
added in the future | ||
+ Recurring entries stores `dayOfRecurrence` to counter varying days in months. Below is a example scenario: | ||
+ Monthly recurring entry dated at 31st August | ||
+ Since September ends on the 30th, recurring entry is added on the 30 September and `lastRecurred` is stored as | ||
30th September | ||
+ `dayOfRecurrence` is used to track the real date of recurrence since the day will be overwritten | ||
|
||
### Budgets | ||
Daily, monthly, and yearly spending totals are calculated everytime a ListCommand is received. This is done by | ||
iterating through each of the spendings stored in SpendingList and comparing their dates to the respective daily, | ||
monthly, and yearly dates. | ||
|
||
### Deleting an entry | ||
The user deletes an entry by sending a delete command which specifies the index of the income/spending to be deleted. | ||
The income or spending will be deleted from its corresponding list using its index. | ||
|
||
|
||
|
||
## Product scope | ||
### Target user profile | ||
|
@@ -19,11 +160,106 @@ | |
{Describe the value proposition: what problem does it solve?} | ||
|
||
## User Stories | ||
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - * | ||
|
||
| Priority | As a ... | I want to ... | So that I can ... | | ||
|----------|----------|------------------------------------------------------|--------------------------------------------------| | ||
| *** | user | start and close the application | use it only when needed | | ||
| *** | user | add my financial transactions | track the flow of my money | | ||
| *** | user | categorise my entries as income and spendings | better understand my financials | | ||
| *** | user | add income and expenditure categories | see my overall net gain or loss | | ||
| *** | user | see all my spendings | know what I spent on | | ||
| *** | user | delete my entries | correct my mistakes | | ||
| *** | user | have a password to my account | protect my account information | | ||
| ** | user | edit my incomes and spendings | correct my mistakes | | ||
| ** | user | categorise my expenses | see what I spend on | | ||
| ** | user | categorise my incomes | see where my savings come from | | ||
| ** | user | read the amount of money left in my allocated budget | gauge how much to spend for the remaining period | | ||
| ** | user | set expenses and incomes as recurring | do not need to manually add them each time | | ||
| ** | Student | set budgets for each category of expense | make better financial decisions | | ||
| * | user | be alerted when I overspend my budget | try to curb my spendings | | ||
|
||
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 this part of the DG particularly! Well done |
||
|
||
## Use cases | ||
|
||
### Use case: Add an Entry | ||
|
||
**Adding an income entry with optional input for date and tag** | ||
|
||
**MSS** | ||
|
||
1. User inputs to add income with description, amount, date, and tag. | ||
2. Wiagi adds the income to the income list. | ||
3. If the date is not provided, Wiagi will use the current date. | ||
4. If the tag is not provided, Wiagi will use the default tag (Empty String). | ||
5. Wiagi will display a message to the user that the income has been added. | ||
|
||
Use case ends. | ||
|
||
**Extensions** | ||
1. User enters invalid input. | ||
1. If the user inputs invalid formatting, Wiagi will display an error message. | ||
2. If the user inputs an invalid amount, Wiagi will display an error message. | ||
3. If the user inputs an invalid date, Wiagi will display an error message. | ||
|
||
Use case restarts at step 1. | ||
|
||
### Use case: Delete an Entry | ||
|
||
**Deleting an income or spending from the list** | ||
|
||
**MSS** | ||
|
||
1. User requests to list all incomes | ||
2. Wiagi shows a list of all incomes | ||
3. User takes note of the index of the income to delete and requests to delete the entry | ||
by specifying the index | ||
4. Wiagi deletes the entry | ||
|
||
Use case ends. | ||
|
||
**Extensions** | ||
- 1a. The list is empty. | ||
<br>Use case ends. | ||
- 3a. The given index is invalid. | ||
- 3a1. Wiagi displays an error message. | ||
<br>Use case restarts at step 1. | ||
|
||
|
||
### Use case: Listing all Entries | ||
**MSS** | ||
1. User requests to list all entries. | ||
2. Wiagi shows a list of all incomes and spendings, including optional parameters such as tags. | ||
|
||
Use case ends. | ||
**Extensions** | ||
1. The list is empty. | ||
- 1a. Wiagi displays incomes and spendings without entries (equal to 0). | ||
|
||
Use case of listing all spendings, incomes, tags is similar, omitted for brevity. | ||
|
||
|
||
### Use Case: Edit an Entry | ||
**Editing an existing income or spending entry** | ||
|
||
**MSS** | ||
|
||
1. User requests to list all incomes or spendings. | ||
2. Wiagi shows a list of all incomes or spendings. | ||
3. User takes note of the index of the entry to edit and requests to edit the entry by specifying the index and new details. | ||
4. Wiagi updates the entry with the new details. | ||
5. Wiagi displays a message to the user that the entry has been updated. | ||
|
||
|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| | ||
Use case ends. | ||
**Extensions** | ||
1. The list is empty. | ||
<br>Use case ends. | ||
2. The given index is invalid. | ||
- 2a. Wiagi displays an error message. | ||
Use case restarts at step 1. | ||
3. The new details are invalid. | ||
- 3a. Wiagi displays an error message. | ||
Use case restarts at step 1. | ||
|
||
## Non-Functional Requirements | ||
|
||
|
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.
Placeholder still here