-
Notifications
You must be signed in to change notification settings - Fork 248
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-T13-2] Expense Tracker #79
base: master
Are you sure you want to change the base?
Changes from 250 commits
bf019eb
8002220
8dff7a9
13b4e36
918a82f
399dae5
72e6dc8
46c4548
89b1883
90ff69d
6f430b9
9407bed
394b4f3
79fabd4
9a2a727
6b46b64
241d168
f60e5bf
aec9774
0b7c8ea
68a75ae
431a3dc
56a07ad
7d140b6
465c0c3
5e90c54
7c87a13
a316eb2
ba1e430
7a17108
b69c4f1
9a258e4
4c2b21f
43825e4
950da9a
22c4094
61aade9
c8721a9
0e4e10f
1327359
b915b1a
6a2b580
eeddf19
054a3da
cb23227
4cb271e
df67b35
baea0a1
292ade6
452758c
e85dd16
421309c
af33514
49397a3
840d969
4ce20af
389a080
cd7ef6b
46c391a
aaa32f1
37cb9e3
56ae3e6
3b1ea1b
b19f8f4
1e15c81
79331eb
9adfe82
df0fa25
fff6da3
1d9ae06
7768f63
d5cb731
e92cae4
d8006cd
ea727a7
cd08acb
a4ba2ee
e62c9ad
f259203
403d524
c7e4d92
9b4e84a
c094248
9c6cec0
4af04c0
f0182ab
81f5983
5e14af6
8c28157
d00ecd6
5372a1a
4977c22
d65b8c4
e942beb
a5c71fe
0ec03d3
f63b7c7
660b010
2f9c832
9154892
427618b
bc44cc4
2605ffc
f872778
b7a081d
6b95ce0
ae399bb
6350971
52c2085
7ec5194
46c61f2
f4237ec
d62bcde
231b341
e3e3d98
b39eb66
2941a18
df8d37a
7761642
6f29d0c
8900a17
af45225
07a677f
1a1a519
0105c7b
cb66253
ca5f28c
2d2d74f
b9a3a05
136ca27
4d636e3
9ab6903
707b207
27ebdc1
8440b5d
86f0ec2
cc7ee58
90cf6db
059cf86
0f88ec9
b8aacbb
fc2c543
eb29e8e
8f4d26a
4244307
4c09678
a51d273
d166c1d
346c71c
537b31b
c664f22
93e63a3
0006c92
37f47e0
f69911b
e5d329c
9c32124
60ad15e
2ebc561
b32ed75
0d31649
c7958ef
e12d9a1
58e2196
eaf488c
ad94d2d
898b9ed
4a7efec
f02e2f7
f14e92a
26d2b56
08bb894
680d559
63be5d8
1d99b88
83446f2
186e34a
7401795
a74d891
c982e38
3b44470
f658a6e
8b6c3cb
30b40dd
087fcf9
ce20651
df3ebaa
89dbcc6
6609863
676964e
50d3282
2243507
3880441
aeace56
e0dc50c
a11063c
240aa32
bced6d4
190026c
f04e272
3401588
4501d8f
e6fa1e5
aa5a15a
f8491b3
7714e6a
a7a49cf
76e7382
49e6f65
b2c6ecb
06ca2f4
362d65e
ac89c31
2970671
939d8c9
84c488f
ea1d747
e33531f
0db0122
9d9eaf7
02b3ad0
6331618
ecbbcaa
e6ba57b
6b276c1
0b7c0c4
53b633b
9ae5fe2
acfb6bb
e8438ad
f10fee7
483a9f8
962c566
40cb849
39b2b4e
3480bc0
f35bf6c
c8f14f1
b8bcd99
ac50f7a
97b212f
1d375b9
d3b79ed
dae27f2
ff796b1
07be2dc
5a648af
4494fe2
3fbd41a
0bdb9ba
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,10 @@ | ||
# Contributors | ||
|
||
Display | Name | Github Profile | Homepage | ||
---|:---:|:---:|:---: | ||
![](https://avatars0.githubusercontent.com/u/22460123?s=100) | Jeffry Lum | [Github](https://github.com/j-lum/) | [Homepage](https://se.kasugano.moe) | ||
![](https://avatars0.githubusercontent.com/u/1673303?s=100) | Damith C. Rajapakse | [Github](https://github.com/damithc/) | [Homepage](https://www.comp.nus.edu.sg/~damithch/) | ||
| Display | Name | Github Profile | Homepage | | ||
|------------------------------------------------------------|:-------------------:|:-------------------------------------:|:--------------------------------------------------:| | ||
| ![](https://media.licdn.com/dms/image/C5603AQECXBzH5HvYew/profile-displayphoto-shrink_800_800/0/1654775943351?e=1683763200&v=beta&t=2H6AN8qbcm5b9uCpDSRhNNOm2qgv4mn21XY2f1QisEM)) | Bui Phuong Nam | [Github](https://github.com/j-lum/) | [Homepage](https://github.com/arsdorintbp2003) | | ||
| ![](https://avatars0.githubusercontent.com/u/1673303?s=100) | Damith C. Rajapakse | [Github](https://github.com/damithc/) | [Homepage](https://www.comp.nus.edu.sg/~damithch/) | | ||
|
||
# I would like to join this list. How can I help the project | ||
|
||
For more information, please refer to our [contributor's guide](https://oss-generic.github.io/process/). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: seedu.duke.Duke | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# 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 | | ||
|------------------------------------------------------|:--------------:|:--------------------------------------------:|:----------------------------------------:| | ||
| ![](https://via.placeholder.com/100.png?text=Photo) | FanZixian | [Github](https://github.com/FanZixian) | [Portfolio](docs/team/fanzixian.md) | | ||
| ![](https://via.placeholder.com/100.png?text=Photo) | GohJinWeiAaron | [Github](https://github.com/GohJW) | [Portfolio](docs/team/gohjinweiaaron.md) | | ||
| ![](https://via.placeholder.com/100.png?text=Photo) | Zhang Zhitong | [Github](https://github.com/Zhang-Zhitong) | [Portfolio](docs/team/zhangzhitong.md) | | ||
| ![](https://via.placeholder.com/100.png?text=Photo) | Ju Can | [Github](https://github.com/ju-can) | [Portfolio](docs/team/jucan.md) | | ||
| ![](https://via.placeholder.com/100.png?text=Photo) | Bui Phuong Nam | [Github](https://github.com/arsdorintbp2003) | [Porfolio](docs/team/BuiPhuongNam.md) | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,30 +4,148 @@ | |
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
|
||
* [JSON-java](https://github.com/stleary/JSON-java) | ||
* [three-ten-extra](https://www.threeten.org/threeten-extra/) | ||
* * Requesting and Parsing of data from API into Java | ||
* https://www.youtube.com/watch?v=lDEfoSwyYFg | ||
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 believe it would be beneficial if this link was a hyperlink, making it easier for readers to click on it. |
||
## Design & implementation | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
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. Perhaps this should be replaced with something along the lines of "This section describes the design and implementation of the product, with UML diagrams and code snippets where applicable." instead. |
||
## Design | ||
![](diagrams/Overall.png) | ||
Our main `Duke` class is responsible for the instantiation and launch of our application. | ||
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 is a formatting issue at this line. I think a double space is missing on line 14 to make it a new paragraph 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. Hmm, I see that your product is called Expense Tracker but the Main Class for this product is called Duke. Perhaps it would be better to rename the Class to fit the product? So that I as a developer won't be confused as to why the class is named Duke. |
||
Our overall project design is split into 5 components, `command`, `common`,`data`, `storage` and `parser`. | ||
- `command`: The command executor. | ||
- `data`: Holds data and data structures of our application. | ||
- `parser`: Reads data from the user input and parses it into an 'executable' command. | ||
- `common`: Holds mainly static data that is used by multiple components. | ||
- `storage`: Handles the reading and storing of our data. | ||
|
||
## Implementation | ||
### 'Add' feature | ||
This mechanism is facilitated by `CommandAdd`, which extends `Command`, as well as `ParserAdd`. `ParserAdd` parses the | ||
user input into a string of words `parsedInput[]` which `CommandAdd` then stores internally. `CommandAdd` also stores an | ||
internal reference to the list of expenses `expenseList` to be added to. | ||
|
||
`CommandAdd` implements the following operations: | ||
- `CommandAdd#execute()` -- Instantiates the `Expense` object with the parsed inputs and adds it to `expenseList` | ||
- `CommandAdd#roundInput(amount)` -- Rounds the expense amount to 2 decimal places. | ||
|
||
`ParserAdd` implements the following operations: | ||
- `ParserAdd#parseInput(userInput)` -- Parses the user input into an array of strings for `CommandAdd` to read. | ||
- `ParserAdd#checkType(input)` -- Checks the type of the input corresponding to its index. | ||
- `ParserAdd#substringIndex(type)` -- Returns the substring index of the start of the user input. | ||
|
||
The `CommandAdd#execute()` operation is exposed in the main `Duke` class, while the operations in `ParserAdd` are | ||
exposed in the `Parser` class. | ||
|
||
Given below is an example usage of the feature. | ||
![](./diagrams/AddFeature.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. Consider describing a little bit about what's going on in the functions called, like use refs or something. 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. Perhaps it would be nice to standardize the fonts in the diagrams, as the words in some diagrams are bolded and the words in others are not bolded |
||
|
||
Step 1. The user executes `add amt/24 t/02-02-2012` as the `userInput` to add a new `Expense` into the the list of | ||
expenses. `Duke` calls `Parser#extractCommandKeyword(userInput)` to parse the input and determines that the `add` command is called. | ||
|
||
Step 2. `Duke` instantiates a new `CommandAdd` and calls `CommandAdd#execute()`, which in turn calls | ||
`Parser#extractAddParameters(userInput)` and `ExpenseList#getExpenseList()`. | ||
|
||
Step 3. `Parser#extractAddParameters(userInput)` then calls `ParserAdd#parseInput(userInput)` and returns the parsed | ||
input as a string of words `parsedInput[]`. | ||
|
||
Step 4. `CommandAdd#execute` instantiates a new `Expense` object with the returned `parsedInput[]` and adds it to | ||
`expenseList`. | ||
|
||
### "Delete" feature | ||
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. Can consider standardizing the header for "Delete" feature whether to address it as ' ' or " " as the rest use singular quotation marks. |
||
|
||
This mechanism is facilitated by `CommandDelete`, which extends `Command`. It makes use of the output from `Parser`, | ||
which takes in the user input as string and returns the index of the expense to be deleted, and the `CommandDelete` | ||
proceeds to remove the respective expense from the list of expenses stored in `expenseList`. | ||
|
||
`CommandDelete` implements the following operation: | ||
- `CommandDelete#execute()` -- Removes expense based on the index specified by user. | ||
|
||
`Parser` implements the following operation: | ||
- `Parser#extractIndex(userInput)` -- Extracts the index of the expense to be deleted, as specified by the user. | ||
|
||
The `CommandDelete#execute()` operation is exposed in the main `Duke` class. The `Parser#extractIndex(userInput)` | ||
is exposed in the `parser` class. | ||
|
||
Given below is an example usage scenario and how the 'delete' mechanism behaves at each step. | ||
|
||
![](./diagrams/DeleteFeature.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. The diagram is missing the activation bar for Duke. 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. Consider extending this sequence diagram to also show what you mentioned in step 3 - how an expense is deleted, in order to add value to this diagram. |
||
|
||
Step 1. The user executes `delete 1` command to delete the 1st expense in the expense list. `Duke#run()` calls | ||
`Parser#extractCommandKeyword(userInput)` to parse the input and determine that the `delete` command is called. | ||
|
||
Step 2. `Duke` instantiates a new `CommandDelete` and calls `CommandDelete#execute()`, which then calls | ||
`expenseList.getExpenseList()` and `parser.extractIndex(input)`. | ||
|
||
Step 3. `CommandDelete#execute()` removes the expense at index specified by the user. | ||
|
||
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 a step by step approach to explain how the command works is a good idea and gives a clear summary of what the method is about, good job. |
||
### Monthly Overview | ||
|
||
This mechanism is facilitated by `CommandOverview`, which extends `Command`. It makes use of output from `Parser` | ||
to extract `month` and `year` from user input. It then calls on `Monthly Overview` if both `month` and 'year' | ||
are not null, which makes use of `MonthFilter` to filter out expenses in that specific month and returns sum by | ||
category sorted in descending order before printing out the final overview in the intended format. | ||
|
||
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 error with For the diagram I think there's a small typo for filteredExpenses(), otherwise good job, it looks quite detailed and readable. |
||
Given below is the sequence diagram to explain how the 'monthly overview' mechanism behaves. | ||
![](diagrams/MonthlyOverview.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. While I am able to understand the role of yearFilter and monthFilter after reading, do consider adding further elaborations to ensure how both filters work. 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. |
||
|
||
|
||
### 'Total' feature | ||
This mechanism is facilitated by `CommandTotal`. | ||
|
||
`CommandTotal` implements the following operations: | ||
- `CommandTotal#calculateTotal()` -- Iterates through the given expense list and calculates the total expenses from its amount and currency exchange rate. | ||
- `CommandTotal#getTotal()` -- Returns the total in 2 decimal places. | ||
|
||
|
||
Displayed below is a part of the class diagram for `CommandTotal`. | ||
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. Possible formatting error here, the image is in the middle of a the line instead of being on a new line and the "displayed below" is actually next to the image rather than above. Possible need to insert a newline using the multiple spaces at the end of the line method as the next line also starts immediately after the image rather than on a new line |
||
![](diagrams/TotalFeature.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 think can consider reformatting the text below the diagram and align it to make it neater. |
||
Give below is an example usage of the feature. | ||
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. Possible typo, should rephrase as "Given below is an example usage of this feature." |
||
|
||
Step 1. The user executes `total`. Duke calls on `CommandTotal#execute()` to calculate the total expenses, which in turn calls | ||
`expenseList#getExpenseList()` to retrieve the expense list. | ||
|
||
Step 2. The expense list is iterated through and `total` is obtained by summing the product of each expenseAmount and rate. | ||
|
||
|
||
## Product scope | ||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
- has a need to manage daily expenses | ||
- travels overseas often and want to keep track of their expenses throughout their travels in different currencies | ||
- prefer desktop apps over other types | ||
- can type fast | ||
- prefers typing to mouse interactions | ||
- is reasonably comfortable using CLI apps | ||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
- Our expense tracker is a simple program that allows users to track their expenses | ||
- With simple commands and ease of use, users are able to use our tracker with little to no experience. | ||
|
||
## 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 ... | | ||
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. Possible formatting error in the table, there is an extra blank column to the right of "So that I can..." note that it is not necessary to match the whitespaces one-to-one for the table in markdown, as github will automatically format it ie. you can do this: | v1.0 | new user | add a new entry for my | - | |
||
|---------|-------------------|-------------------------------------------------------------|------------------------------------------------------------------------------------------| | ||
| v1.0 | new user | add a new entry for my expenses | - | | ||
| v1.0 | user | delete specific expenses | - | | ||
| v1.0 | user | add expenses with dates | track how much I spend each day | | ||
| v1.0 | user | add expenses of different categories | keep track of what I spend on | | ||
| v1.0 | user | see all my past expenses | plan my budget accordingly | | ||
| v2.0 | user | save all expenses added | - | | ||
| v2.0 | user | add expenses with specified currencies | know the exact amount I spent in different currencies | | ||
| v2.0 | user | sort my expenses by category/date | better keep track of my expenses through either date or category | | ||
| v2.0 | user in Singapore | see my total spending in SGD | - | | ||
| v2.0 | user in Singapore | see an overview of my expenses in a particular month in SGD | understand what categories I like to spend on and better plan my spending in the future. | | | ||
|
||
|
||
## Non-Functional Requirements | ||
|
||
{Give non-functional requirements} | ||
* Expense tracker should function with or without an internet connection. | ||
* Expense tracker should work even on days where the forex market is closed | ||
|
||
## Glossary | ||
|
||
|
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.
Appears to be a duplicated bullet point in this line, possible formatting error?