-
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-F14-4] Financer #50
base: master
Are you sure you want to change the base?
Changes from 177 commits
baee009
0056ddc
65329cc
605cd58
183e1f1
f005ae5
e9c39fd
1028f25
213ca4e
df20268
67858a6
8ff91d8
4d31900
c9dd575
9a6a752
3286fee
6d8a85b
d340e68
25b5c1c
e4d350b
d9ea107
0c8ccf5
6674f07
8c4bc5c
32e2e18
2d2724c
8b6a8a7
9111b7f
653f4bf
dda450d
f012642
bc73d63
8118dcc
a4232ee
169d765
a359bdf
eeeae09
42e0400
64eaaf9
7555d83
5eeb9c1
d22e4f9
30e496c
8ce45ff
7adf321
87c28d9
f7e2dd1
a58ba0b
ac44b10
b487aba
855fd3e
7c1aae2
8578ef2
21cd082
ec85f7e
706552d
7c89346
2eebc4c
19c51c7
50883f5
0e928cb
8f8e352
57cc090
5b56e77
1ecc74d
7635e41
f7f78e4
456aeb2
b5702e7
1ff6af0
36cdc0b
5ea3fb6
e32307c
591e310
022a87e
b0a290d
d118630
b542850
83163ef
2b0d299
a295ed6
25356a4
fcea0fd
917bf63
4873161
5887295
b987a56
b7daccc
e0e74ab
1675cd4
2107aa4
005cea2
973af97
8d25764
08f4f9d
6b7f245
ece74a4
ace737f
44e12ca
d4c7660
298786f
df75771
11f6251
f13e3a5
19cc0fb
26131d9
5514ae2
016614a
83c3859
61d9301
b62e961
0dcf748
d346be3
1e79323
8de07f7
c205b74
dde789f
c1b40d0
b5214b4
1531954
48623d6
694dde8
f604d4b
c55a6c1
a84503a
a602006
a1e9a0c
32f0d97
90b2ed7
6dc63a6
245851d
95ecd55
e9ead89
2c754e0
8b5a1fd
fbe8f59
49e0a3a
8a4550e
9fcdf5f
ab928ae
2deffa4
02ea959
ffa999b
506afd9
7942f57
d2c7392
d55b1bb
ae4d45d
e929050
8ef9ffe
19a13a3
3fd991d
1cc162e
8942630
71d9333
93f8796
6a45d0e
a4a4d6d
f1449d1
ee8dcb3
81f4a2b
8266a43
b414e5d
a1d0568
88e4681
5e49f28
51d56aa
90af69b
b909759
fe15baf
9d81d4c
8442416
919f322
b40aee0
5f0b41c
af8c306
6fc74eb
9016d3c
2b821e7
2b2d574
7846a51
bbd399a
da5b5ec
53ce177
70c7793
73a7f16
0dfe6e1
7da853d
a58ba23
dbde541
9a3cf9a
c89aa9f
a7370c2
7c4a5d9
de502c0
cef5ebc
7a77063
8c980b6
5b967ed
c062955
7b39d1d
0b950f5
94a3851
06bf2f9
a3ba484
ea0050a
6a85779
8773e5e
80293cd
d65b0d7
0f446dd
1e2af6d
8f8431e
5f142af
abbc8f4
9c74851
61954a8
549daad
09ad23b
7240e85
e866a60
8b60cec
6f74b5f
1204c09
6213705
509ebb3
668bfe9
f5239b5
cfedd57
74cf690
497ea8b
350851d
b6e1f29
64377f4
d4b7b67
a32d147
f3b9580
bc67f8a
e2ebf76
60069f1
2ddc7e0
b83adeb
ddd22c1
d4f74ba
4c28fae
a376dfe
7af0f79
c862525
3790710
84afa18
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "interactive" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Define the base directory variables | ||
SRC_DIR="src" | ||
BUILD_DIR="build" | ||
CLASSES_DIR="$BUILD_DIR/classes" | ||
LIBS_DIR="$BUILD_DIR/libs" | ||
JAR_NAME="Financer.jar" | ||
|
||
|
||
# Compile the Java files | ||
find "$SRC_DIR" -name "*.java" ! -path "*/test/*" > sources.txt | ||
javac -d "$CLASSES_DIR" @sources.txt | ||
rm sources.txt | ||
|
||
# Package the .class files into a .jar file | ||
cd "$CLASSES_DIR" | ||
jar cvf "../libs/$JAR_NAME" * | ||
cd - | ||
|
||
echo "Compilation and packaging complete." |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Bob|password |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,36 +3,138 @@ | |
## Acknowledgements | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
- [CS2113 Course Website](https://nus-cs2113-ay2324s2.github.io/website/index.html) | ||
|
||
## Design & 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. Must include an overview of how each classes interact with one another. For instance, include a UML diagram of how UI interacts with exceptions or Parser interacts with UI. |
||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
|
||
The financial manager application is designed using an object-oriented approach, focusing on user authentication, transaction management, and user interaction. The core components include: | ||
|
||
- **Main Application Loop**: Handles the initialization of the application, including loading data from storage, authenticating the user, and processing user commands until the application exits. | ||
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 could include an architecture diagram to show how these components interact with each other at a higher level. |
||
- **Command Pattern**: User commands are encapsulated as objects, allowing for the addition of new commands with minimal changes to existing code. | ||
- **Transaction Management**: Separate classes for managing inflows and outflows, with a unified interface for adding, editing, and deleting transactions. | ||
- **User Authentication**: Ensures that users are authenticated before accessing their financial data, with a mechanism to track and limit failed attempts. | ||
- **Inactivity Timer**: Automatically logs out users after a period of inactivity, enhancing security. | ||
- **Storage Management**: Handles the persistent storage of transaction data, allowing users to save and load their financial information. | ||
- **[Proposed] Security features**: A maximum of three login attempts are inputted, failing which would cause the application to be exited automatically. | ||
- **[Proposed] Financial transaction visualiser**: When viewing history of transactions, the data will be visualised using bar charts for better user friendliness. | ||
- **[Proposed] Undo functionality**: Allows users to undo their last prompt, but only permittable 10 seconds after the last action. | ||
|
||
### View Transaction History feature: | ||
|
||
#### Implementation Details: | ||
|
||
#### Functionality: | ||
The View History feature allows users to retrieve a list of their recent transactions, categorized as inflows and outflows. The user can specify the number of transactions they want to view, and the system presents these transactions in reverse chronological order, with the latest transactions displayed first. Each transaction is presented with its description, date, and time of occurrence. | ||
|
||
#### Design Considerations: | ||
- **Data Structure**: The transaction data is stored in an instance of the `TransactionList` class, which is part of the `financialtransactions` package. This list maintains a record of all transactions made by the user, ensuring easy retrieval and manipulation of transaction data. | ||
- **Categorization**: Transactions are categorized as inflow or outflow based on their type. This categorization enables users to differentiate between different types of financial activities, such as income and expenses. | ||
- **Formatting**: The transactions are presented in a formatted string, providing clear and concise information to the user. Each transaction includes its description, date, and time. | ||
|
||
#### Implementation Details: | ||
- The `TransactionManager#showLastNTransactions()` method is responsible for retrieving the last N transactions from the Transaction List. | ||
- The method iterates over the transaction list in reverse order, starting from the latest transaction and moving towards older transactions. | ||
- Transactions are categorized as inflows or outflows based on their instance type (Inflow or Outflow), and the relevant transactions are added to the output string accordingly. | ||
- The formatted string containing the transaction details is returned to the user for display. | ||
|
||
#### Alternatives Considered: | ||
During the development of the View Transaction History feature, several alternatives were considered to achieve the desired functionality. These alternatives included: | ||
|
||
- Implementing a more complex data structure for storing transaction history, such as a linked list. However, a simple ArrayList-based approach was chosen for its simplicity and efficiency in managing transaction data. | ||
- Providing additional filtering options, such as filtering transactions by date range or transaction category. While these options could definitely enhance the feature, they were deemed unnecessary for the initial implementation and may be considered for future iterations. | ||
|
||
### Save File feature: | ||
The `Storage#saveFile()` method will be called when the user decides to quit the application, the method will then get a string of all the transactions. This string will then be written to a file whose filename will be the username of the last user. | ||
|
||
#### Implementation Details: | ||
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. Should have included a loading data sequence diagram to explain how FileWriter object was created when Main is started. |
||
- The method first creates a FileWriter object. | ||
- It then calls `TransactionManager#toSave()`. | ||
- This method is similar to `toString()`, except that it creates a string that is more storage friendly. | ||
- In this method, each transaction is returned as `name|amount|date|category\n`. | ||
- Each transaction is added line by line, after adding all transactions, the string is returned in the toSave() method. | ||
- It is important to note that outflows are saved with a `-` in front of the amount. | ||
- With the string generated in the `toSave()` method, the FileWriter will write it to the file before closing it. | ||
|
||
### Load File feature: | ||
The `Storage#loadFile()` method will be called after the user as logged in, it will then retrieve the transactions that were written in the past sessions, so that the user can continue using the finance manger. | ||
|
||
#### Implementation Details: | ||
- The method first creates a File object and a Transaction Manager object. | ||
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 could include a class diagram to demonstrate how the saveFile class works. |
||
- If the file exists | ||
- The method will read from the file line by line, splitting each line by `|`. A new inflow or outflow object will be created with those values and then added to the Transaction Manager Object. | ||
- If the file does not exist | ||
- An empty transaction manager object will be returned. | ||
- To differentiate between inflow or outflow, the `-` in front of the amount will be used. | ||
|
||
## Product scope | ||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
The financial manager application is designed for individual users seeking a simple yet powerful tool to manage personal finances, including tracking income and expenses, and viewing transaction history. | ||
|
||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
This application simplifies personal financial management by providing an intuitive interface for tracking and analyzing income and expenses. Users can easily add, edit, or delete transactions, view recent transaction history, and ensure their data is securely managed with user authentication and automatic logout features. | ||
|
||
|
||
## 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/an ... | I want to ... | So that ...| | ||
|-------|-------------|---------------|------------| | ||
|v1.0|user|receive alerts or notifications when I exceed my budget limits for specific expense categories|I can stay within my financial goals| | ||
|v1.0|user|generate monthly reports summarizing my income, expenses, and budget performance|I can track my financial progress over time| | ||
|v1.0|user|edit or delete past transactions|I can correct any errors or update information as needed| | ||
|v1.0|user|search for specific transactions based on keywords, dates, or categories|I can quickly find the information I need| | ||
|v1.0|user|add income transactions with details such as amount, date, and category|I can keep track of my earnings| | ||
|v1.0|user|add expense transactions with details such as amount, date, and category|I can monitor where my money is going| | ||
|v1.0|user|categorize my transactions|I can organize my finances and have a clearer view of my income and expenses| | ||
|v1.0|user|add instalment payments into the tracker|I can track finances for big ticket purchases such as furniture/TVs| | ||
|v1.0|user|Use a customisable interface for my financial goals|I can adjust these financial goals accordingly as time passes| | ||
|v1.0|user|add payment types such as credit card, debit card or cash|I can be reminded to pay credit card bills each month| | ||
|v1.0|user|Be confident that my banking information is encrypted and safe from being accessed by others|The private information is not easily leaked to others| | ||
|v2.0|user|Export my financial reports as a CSV|I can share my expenditure with my peers| | ||
|v2.0|user|Visualise my transactions in more meaningful diagrams|I can better understand my spending| | ||
|
||
## Non-Functional Requirements | ||
|
||
{Give non-functional requirements} | ||
1. **Security**: User authentication must be secure, with a limit on login attempts to prevent unauthorized access. | ||
2. **Usability**: The application should be easy to use, with clear instructions and feedback for users. | ||
3. **Performance**: The application should respond quickly to user inputs, with minimal delays in processing transactions. | ||
4. **Reliability**: Data storage should be reliable, ensuring that user data is not lost between sessions. | ||
|
||
|
||
## Glossary | ||
|
||
* *glossary item* - Definition | ||
1. **Inflow** - A financial transaction representing income or money received. | ||
2. **Outflow** - A financial transaction representing expenses or money spent. | ||
|
||
|
||
## 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} | ||
### Login Procedure: | ||
- Start the application and enter your username and password when prompted. | ||
- Test incorrect passwords to ensure the application correctly limits login attempts. | ||
- [v2.0] If there are three incorrect attempts, the application will automatically exit and the user has to try again. | ||
|
||
### Adding Transactions: | ||
- Use the `add-inflow` and `add-outflow` commands to add new transactions, following the command format provided in the `help` command. | ||
- Attempt to add transactions with missing or incorrect information to test validation. | ||
|
||
### Editing and Deleting Transactions: | ||
- Use the `edit-inflow` and `edit-outflow` commands to modify existing transactions. | ||
- Use the `delete-inflow` and `delete-outflow` commands to remove transactions. | ||
- Try editing or deleting transactions that do not exist to test error handling. | ||
|
||
### Viewing Transaction History: | ||
- Use the `view-history` command to display recent transactions. | ||
- Test with different numbers of transactions to view. | ||
- [v2.0] Additional bar charts will be shown to display the different percentage of categories used in the past n transactions. | ||
|
||
### Inactivity Timeout: | ||
- After logging in, do not input any commands for the duration specified by the inactivity timer to test automatic logout. | ||
- A maximum of 2.5 minutes of inactivity will trigger the application to check with the user whether the user is still active or not. Input `yes` to indicate continued activity, otherwise input `no` to exit. | ||
- 30 seconds after the 2.5 min (3 min), the application will automatically exit. | ||
- Implemented to provide enhanced security, so no third party can access finance transactions. | ||
|
||
### Data Persistence: | ||
- Exit the application and restart it to ensure that previously entered transactions are still present. |
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.
Don't forget to remove the skeleton code that comes with the DG!