-
Notifications
You must be signed in to change notification settings - Fork 89
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-W12-2] CashLeh #11
base: master
Are you sure you want to change the base?
Changes from 250 commits
406335c
0e10abc
57953f4
01c20be
fc7eaad
fb768be
557b329
ecfa47f
7df05f6
5e8dd08
0f24ce7
ade5918
30f1309
b1e2917
66a08dc
eebd460
ee3e588
efc7003
53afe57
a0d9a10
4224cce
87e93c4
5ea8754
9e0391a
eb86492
8995f46
6bfcf62
5b9238d
3779bca
9cfbcd6
ad79858
7666b31
09ddab1
9cb7ee8
f056394
21a12f5
6a51357
b5cfcaa
ff1b04c
f79bc59
27a3e34
6ae7e63
84ac84a
a3eba03
2cd751c
80917ab
5a86869
839739c
0e2c3bb
211708a
81509ca
60b40c3
e0d5d35
09641a2
94fee02
5f35b63
754e9c9
65b69d3
86f7202
6398e5b
9280e9e
8d8333e
5113761
b35c7bd
30cd6d8
236e4ba
59d9b6d
4b577e5
fca76fb
5616013
d210071
d70a426
51b5efd
fc7c2c5
64791a5
8fb8f78
6edfbc9
6e0a0ca
60df795
3194157
dbeb548
d65c3f3
28d077c
34e20c3
affb7f2
0ce0fbf
b736d0c
561196f
1a79b70
9f22f4b
0717dd7
5b6b13e
9deb53e
2a9710f
1d40f02
90163e7
fc54537
cfa5ed3
5f357c9
7b718d9
81a0ead
dcf6f6b
d339925
a01a199
612a2ff
e9d84eb
2997545
87719cc
0dbaeae
7fc231f
44deed6
c51568b
709590f
5a11de0
7d4512c
b99ec46
dcc4478
5de4374
711b3bd
2a21f78
f084a45
a37384f
41bb30a
450785c
026294a
81831c4
c8a89e2
e03222c
0c92684
8ab6a2d
25d2814
ccc16c7
d3c436a
3d0e027
48a3983
fad9f08
a625981
369210b
826e652
0064c8d
e830844
f37965a
0ac6dbe
da387c2
e6fd502
690a8bb
67a43ff
797f4f5
0fb2e25
46d12dc
fe4845b
ac7806d
601cdac
f32dab3
d3f615e
f9ec6a0
eb59882
c1e105b
6bfd2c1
a33ce24
bd2e8ae
6a0def3
3fb707b
d104003
f4f158a
abfe446
1334860
0f2d4bb
30454ea
5bac67e
b58bcec
38c3187
ce17958
89fe8c8
7e7f90b
0e1438b
66b5f2f
2066239
82a9e00
2f2a492
59fac18
0ad7518
b070c3d
4cca17f
84b9c9b
83b9819
7a48dc3
a95c2ea
c94ead0
867a713
6467d5c
ab639f9
f22b0a4
b1ebc44
2d3ef1e
307451e
a507cb3
ffc107f
b9a3d86
6a045d1
2c340af
023f405
01e96bc
61f3b43
c4f34d7
fa0544f
3167093
3691a55
de52a3b
77e237d
f7e5164
36fa3ed
bf82329
88c59d2
c9d4851
8a2a356
f92bf3e
f202a74
e1222a4
cf00be8
5bd1b87
1931f96
37ed14b
4c2a190
7688737
d4d323f
bded3e7
9d612a7
aee9c09
3255b27
99a0a21
6c36704
0f6962c
151d640
69f33ac
fa6c258
55a39f2
9ed6024
570b0c0
ac5b442
a40bcda
031c814
a4e32b0
3a1c9e0
def2637
2f4a866
1cac06e
a8cfce8
b8b2a04
90273cf
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 |
---|---|---|
|
@@ -14,4 +14,3 @@ src/main/resources/docs/ | |
bin/ | ||
|
||
/text-ui-test/ACTUAL.TXT | ||
text-ui-test/EXPECTED-UNIX.TXT |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: cashleh.CashLeh | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[I] Income: Salary (Amount: 2000.0, Date: 31/10/2023) | ||
[I] Income: Bonus (Amount: 500.0, Date: 31/10/2023) | ||
[E] Expense: Groceries (Amount: 100.0, Date: 31/10/2023) | ||
[E] Expense: Utilities (Amount: 150.0, Date: 31/10/2023) |
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) | Ming Chun | [Github](https://github.com/mcmc101001) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Shan YuXuan | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Daniel Pappalardo | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Benedict Chan | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Kai Ning | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,37 +2,186 @@ | |
|
||
## Acknowledgements | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
Referred to https://se-education.org/addressbook-level3/DeveloperGuide.html when drafting the DG | ||
|
||
## Design & implementation | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
### Architecture | ||
|
||
![](./images/architeture.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. Good job on the architecture diagram. |
||
|
||
The Architecture Diagram given above explains the high-level design of the App. | ||
|
||
The **User** sends command which is processed by Input | ||
|
||
**Input**: Receives user input string, processes it and sends to CashLeh main app | ||
|
||
**CashLeh**: main app | ||
|
||
**UI**: Responsible for the printing onto CLI | ||
|
||
**Parser**: Process the input string and calls respective methods | ||
|
||
**FileStorage**: Reads data from, and writes data to file | ||
|
||
### How the architecture components interact with each other | ||
|
||
![](./images/main_example.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. 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. Also, from the code it seems like the 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 choose to showcase the sequence diagram of a command that will show interaction with the 'FileStorage' component as it is included in the architecture diagram. Especially if it is majorly involved in the operation of the app. 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. Perhaps you might want to add in an activation bar for |
||
|
||
The Sequence Diagram above shows how the components interact with each other when the user enters a command | ||
|
||
### Budget Handler | ||
|
||
![](./images/budget.png) | ||
|
||
### String Tokenizer | ||
|
||
The String Tokenizer assists in the parsing of user input. It is used to split the user input into a hashmap according to the delimiter/prefix of each command. This allows the developer to more easily customize the commands and add new commands without having to worry about the parsing of the user input. | ||
|
||
> **Example**:\ | ||
> `addIncome money /amt 1000 /date 2021-10-10` with prefixes array `{"addIncome", "/amt", "/date"}` will be tokenized into a hash map with the following key-value pairs:\ | ||
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. For the date variable, you could specify, what types of date you would accept, only YYYY/MM/DD? or would DD/MM/DD work |
||
> `addIncome: money`\ | ||
> `amt: 1000`\ | ||
> `date: 2021-10-10` | ||
|
||
Delimiters can also be specified as optional by adding ":optional" to the end. This allows the user to omit the prefix when entering the command. | ||
|
||
#### Implementation | ||
|
||
The tokenize function is implemented by the StringTokenizer class. It takes in the user input and the prefixes array and returns a hashmap of the user input. | ||
|
||
![](./images/stringTokenizer.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. 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. Good effort in describing the sequence diagram! Perhaps you might want to include the activation bar when the classes are activated, similar to the sequence diagram in the 'transaction filter' section. |
||
|
||
**Step 1**\ | ||
Check if all necessary prefixes are present in the user input. If not, throw an exception. | ||
|
||
**Step 2**\ | ||
Generate list of PrefixWithPosition (containing the prefix/delimiter and the position in the string) for the delimiters in the user input | ||
|
||
**Step 3**\ | ||
Sort the list of PrefixWithPosition by position in order to get the prefixes in the correct order | ||
|
||
**Step 4**\ | ||
Create a hashmap of the user input by splitting the string using the prefixes' positions and adding the key-value pairs to the hashmap | ||
|
||
### Transaction Filter | ||
The filter function assists in filtering both expenses and incomes according to the specified criterion from user's input. | ||
|
||
#### Implementation | ||
![](./images/FilterTransaction.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. 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. |
||
|
||
**Step 1**\ | ||
The filterBy() method is called, returning a FindParser object | ||
|
||
**Step 2**\ | ||
A FilterTransaction object is constructed, with the FindParser object as one of its parameters | ||
|
||
**Step 3**\ | ||
From the expenseStatement and incomeStatement, the financialStatement is constructed. | ||
|
||
**Step 4**\ | ||
Execution of the FilterTransaction class calls method findTransaction(), which prints expenses and incomes that match the provided criterion | ||
|
||
### File Storage | ||
|
||
The FileStorage class in the CashLeh? application facilitates the reading and writing of financial transaction data to and from a file. It simplifies the process of managing user data, making it easily accessible and modifiable through the following methods: | ||
|
||
#### Reading Data | ||
![](./images/readFromFile.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. Does "Data read successfully" need to be inside the alt box corresponding to correct transaction format? |
||
|
||
**Step 1**\ | ||
The `readFromFile` method checks if the specified file exists. If not, it creates an empty file with the user's name as the file path | ||
|
||
**Step 2**\ | ||
After ensuring the file exists, the method parses the data by reading each line from the file. It distinguishes between income and expense transactions based on a type identifier | ||
|
||
**Step 3**\ | ||
For each transaction line, the method validates the format. It checks if essential details like transaction type, description, amount, and date are present. If any information is missing or the format is corrupted, a `CashLehFileCorruptedException` is thrown | ||
|
||
**Step 4**\ | ||
Valid transactions are used to create `Income` or `Expense` objects, depending on their type. These objects are added to the provided `IncomeStatement` and `ExpenseStatement` to populate the financial data. | ||
Comment on lines
+138
to
+148
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. In general, the explanations of sequence diagrams throughout your DG are well written and easy to follow. |
||
|
||
#### Writing Data | ||
![](./images/writeToFile.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. Return arrows should be dotted 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. Might want to also have return arrows for transaction and expense transactions? 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. Really well illustrated loops |
||
|
||
**Step 1**\ | ||
The `writeToFile` method opens the file corresponding to the user's name and prepares to write the financial data into the file | ||
|
||
**Step 2**\ | ||
The method iterates over the transactions stored in the `IncomeStatement` and `ExpenseStatement` objects to collect the data | ||
|
||
**Step 3**\ | ||
For each transaction, the method writes data in a specific format. This includes the type identifier ('I' for income and 'E' for expenses) and transaction details, ensuring structured and organized data for future retrieval | ||
|
||
**Step 4**\ | ||
If errors occur during the write process, such as file writing issues or issues with regards to obtaining the transaction information, the method throws a `CashLehWriteToFileException` | ||
|
||
## Product scope | ||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
* CashLeh? is a CLI program | ||
* It is designed to work for a single user | ||
* CashLeh?'s target audience mainly comprises younger working adults and students who have limited incomes and need to | ||
carefully plan out their expenses and account for their earnings | ||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
CashLeh? is a financial tracker made specifically for working adults who have just began to earn their first salaries | ||
and wages and might need some support finding the correct spending balance. College students and young workers often | ||
struggle with their countless expenses ranging from rent, utilities, groceries and food, tax etc. CashLeh?, though | ||
very simple and intuitive, is supposed to make the process of financial management seamless for them and help them avoid | ||
unnecessary expenses. | ||
|
||
## 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| new user | see usage instructions | refer to them when I forget how to use the application | | ||
|v1.0| user | be able to add my incomes and earnings | easily manage them and obtain access to an overview | | ||
|v1.0| user | be able to delete my incomes and earnings | correct any mistakes and errors | | ||
|v1.0| user | be able to view the sum of my incomes | be fully aware of my income situation and manage my money | | ||
|v1.0| user | be able to view the list of all incomes | be able to view the entire history of incomes | | ||
|v1.0| user | be able to add my expenses and spendings | easily manage them and obtain access to an overview | | ||
|v1.0| user | be able to delete my expenses and spendings | correct any mistakes and errors | | ||
|v1.0| user | be able to view the sum of my expenses | be fully aware of my expense situation and manage my money | | ||
|v1.0| user | be able to view the list of all expenses | be able to view the entire history of expenses | ||
|v2.0| user | be able to view both incomes and expenses together | have an overview of my net financial situation | | ||
|v2.0| parsimonious user | be able to set an overall budget | have an upper limit for my relative expenses | | ||
|v2.0| user | be able to view my budget | view my financial situation and organise myself | | ||
|v2.0| user | be able to delete my previously set budget | not care about an upper limit or eventually set a new budget | | ||
|v2.0| user | be able to label categories of each income | can know which category the income belongs to | | ||
|v2.0| user | be able to label categories of each expense | can know which category the expense belongs to | | ||
|v2.0| user | be able to filter my transactions | better understand my financial history and easily access information | | ||
|
||
## 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. The application should be easy to use for first-time users | ||
|
||
## Glossary | ||
|
||
* *glossary item* - Definition | ||
* *Mainstream OS*: Windows, Linux, Unix, OS-X | ||
|
||
## Instructions for manual testing | ||
|
||
{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing} | ||
### Launch and shutdown | ||
|
||
#### 1. Initial launch | ||
|
||
1. Download the jar file and copy it into an empty folder | ||
2. Open the terminal and run the command `java javac- Cashleh.jar` | ||
3. CashLeh? should launch and you can start interacting with the application | ||
|
||
### Refer to user guide for commands | ||
|
||
## Proposed implementations of future features | ||
|
||
* Create periodic income and expenses (subscription fees, salaty etc.) | ||
* View sum of income and expenses base on specified time range | ||
* Password protection when starting app | ||
* Able to reset password | ||
* More personal information in addition to name (location, age, etc.) | ||
* Tutorial/guide to use the app | ||
* Able to set preferred currency, all transaction to be converted accordingly | ||
* Able to change description, amount, date, and categories of transactions | ||
* Able to view the transaction information in graphs and charts for visualisation |
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.
Could consider making this an actual link?