Skip to content

Commit

Permalink
Merge branch 'master' into VisDG
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/seedu/financialplanner/commands/VisCommand.java
  • Loading branch information
wwweert123 committed Nov 3, 2023
2 parents 2447cba + 3f4327a commit d95af1b
Show file tree
Hide file tree
Showing 36 changed files with 902 additions and 162 deletions.
91 changes: 73 additions & 18 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* [Visualization Feature](#visualization-feature-)
* [Class diagram](#class-diagram)
* [Sequence diagram](#sequence-diagram-)
* [Add income/expense feature](#add-incomeexpense-feature)
* [Step 1](#step-1)
* [Step 2](#step-2)
* [Step 3](#step-3)
* [Step 4](#step-4)
* [Diagrams](#diagrams)
* [Add Income/Expense Feature](#add-incomeexpense-feature)
* [Class Diagram](#add-incomeexpense-class-diagram)
* [Sequence Diagram](#add-incomeexpense-sequence-diagram)
* [Recurring Cashflow Feature](#recurring-cashflow-feature)
* [Class Diagram](#recurring-cashflow-class-diagram)
* [Sequence Diagrams](#recurring-cashflow-sequence-diagrams)
* [Budget Feature](#budget-feature)
* [Set and update budget](#set-and-update-budget)
* [Delete budget](#delete-budget)
Expand Down Expand Up @@ -160,7 +160,7 @@ Visualizer (`displaying chart` ref from overall sequence diagram above)

![](images/vis/visualizerSequence.png)

### Add income/expense feature
### Add Income/Expense Feature

The add income/expense command has 2 compulsory arguments `/t` and `/a` and 1 optional argument `/r`.

Expand All @@ -169,12 +169,9 @@ Example:
add income /a 100 /t salary /r 30
```
Below are the steps that shows the implementation of add income/expense.
#### Step 1
An instantiated AddCashflowCommand class gets the instance of CashflowList.

This allows the AddCashflowCommand instance to access the methods of CashflowList.
#### Step 2
The AddCashflowCommand instance then calls addIncome() or addExpense(), depending on what `category` is initialised as.
#### Step 1
The AddCashflowCommand instance calls addIncome() or addExpense(), depending on what `category` is initialised as.

addIncome() or addExpense() instantiates an Income or Expense object respectively.

Expand All @@ -192,20 +189,78 @@ switch (category) {
break;
}
```
#### Step 3
#### Step 2
The instantiated income/expense then updates the overall balance through addIncomeValue() or addExpenseValue().

The income/expense object is also added to the list in Cashflowlist which contains all incomes/expenses.
#### Step 4
#### Step 3
The added income/expense is then displayed to the user through the Ui.

#### Diagrams
#### Add Income/Expense Class Diagram
Given below is the class diagram showing the class structure of the add income/expense mechanism:
![](images/CashflowClassDiagram.png)

![](images/cashflow/CashflowClassDiagram.png)
#### Add Income/Expense Sequence Diagram
Given below is the sequence diagram showing the add income/expense mechanism:
![](images/AddCashflowSequence.png)
![](images/cashflow/AddCashflowSequence.png)
### Recurring Cashflow Feature
Cashflow refers to an income or expense.

This feature is called from the user through the `/r` argument in add income/expense command.

If a cashflow is set to be recurring, the program would add another entry of the same cashflow to the Financial Planner after a set period of time.

Below are the steps that shows the implementation of the recurring cashflow feature.

#### Step 1
Once the cashflow is set to be recurring, its corresponding `Cashflow` object would store the date at which the cashflow was added to the Financial Planner.

The `recur` variable in the object would also be instantiated according to the user's input.

An additional `boolean` variable, `hasRecurred` is stored in the object and is set to `false` by default.

Example:
```
public abstract class Cashflow {
protected int recur;
protected LocalDate date;
protected boolean hasRecurred;
}
```
#### Step 2
When the Financial Planner is started again in the future, the date of startup would be obtained from the system.

After loading existing saved cashflows from data.txt, the program will check for cashflows that are set to be recurring and has not recurred.

Example:
```
if (recur > 0 && !hasRecurred) {
...
}
```

#### Step 3
Once a cashflow matches the above criteria, the date of its next addition to the Financial Planner, `dateOfAddition`, would be determined.

`dateOfAddition` would be compared to the current date, and if the current date is after or equal to `dateOfAddition`, an identical cashflow would be instantiated.

This identical cashflow would then have its `date` variable set to `dateOfAddition`, then this cashflow would be added to a temporary list, `tempCashflowList`.

The original cashflow would then have its `hasRecurred` variable be set to `true`.

#### Step 4
Each cashflow in `tempCashflowList` goes through **Step 3** again, so that multiple cashflows can be added if it has recurred more than once.

Once the process is done, all cashflows in `tempCashflowList` are then added to the Financial Planner.

The added cashflows are then displayed to the user.

#### Recurring Cashflow Class Diagram
Given below is the class diagram showing the class structure of the recurring cashflow mechanism:
![](images/cashflow/RecurClassDiagram.png)
#### Recurring Cashflow Sequence Diagrams
Given below is the sequence diagram showing the recurring cashflow mechanism:
![](images/cashflow/RecurSequence.png)
![](images/cashflow/AddRecurringSequence.png)

### Budget Feature

Expand Down
165 changes: 162 additions & 3 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@
* [WatchList](#viewing-watchlist-watchlist)
* [Adding Stock](#adding-stock-to-watchlist-addstock)
* [Deleting Stock](#deleting-budget-budget-delete)
* [Visualization](#Visualization)
* [ReminderList](#view-reminder-list-reminderlist)
* [Adding Reminder](#add-reminder-addreminder)
* [Deleting Reminder](#delete-reminder-deletereminder)
* [Marking Reminder as Done](#mark-reminder-as-done-markreminder)
* [WishList](#view-goal-list-wishlist)
* [Adding Goal](#set-goal-set-goal)
* [Deleting Goal](#delete-goal-deletegoal)
* [Marking Goal as Achieved](#mark-goal-as-achieved-markgoal)
* [Visualization](#visualizing-your-cashflow-vis)
* [Exiting the program](#exiting-the-program-exit)
* [Saving data](#saving-the-data)
* [Loading data](#loading-the-data)
Expand Down Expand Up @@ -62,6 +70,9 @@ you a one-stop interface to access a plethora of features to manage your finance

e.g. `[/r DAYS]` can be used as `/r 30` or left empty.

### Notes about naming convention
- Cashflow refers to an income or expense.

### Add cashflow

#### Add income: `add income`
Expand Down Expand Up @@ -252,9 +263,9 @@ You have removed an Expense
Description: groceries
from the Financial Planner.
Balance: -830.00
- Note: Balance displayed above is just an example. Your actual balance may differ.
```

- Note: Balance displayed above is just an example. Your actual balance may differ.
### List

#### List all: `list`
Expand Down Expand Up @@ -536,6 +547,154 @@ Use watchlist command to view updated Watchlist

- Note: Your watchlist information is saved under the file path `data/watchlist.json` in JSON format

### View Reminder List: `reminderlist`
View your current reminder list with reminders that you have added.

Format: `reminderlist`

Example of usage: `reminderlist`

Example of output:

```
Here is your reminder list:
1. Reminder
Type: debt
Date: 2023.12.11
Status: Not Done
2. Reminder
Type: loan
Date: 2023.12.18
Status: Not Done
```

### Add reminder: `addreminder`
Adds a reminder to the Financial Planner.

Format: `addreminder /t TYPE /d DATE`
- `/t` is used to specify the reminder type, which describes what is the reminder used for.
- `/d` is used to give a deadline date to the reminder.

Example of usage: `addreminder /t debt /d 2023.12.11`

Example output:
```
You have added Reminder
Type: debt
Date: 2023.12.11
Status: Not Done
```

### Delete reminder: `deletereminder`
Deletes a reminder from the Financial Planner.

Format: `deletereminder INDEX`

- `INDEX` refers to the index number shown in the displayed list when [`reminderlist`](#view-reminder-list-reminderlist) command is used.

Example of usage: `deletereminder 1`

Example output:
```
You have deleted Reminder
Type: debt
Date: 2023.12.11
Status: Not Done
```

### Mark reminder as done: `markreminder`
Marks a reminder as done in the Financial Planner.

Format: `markreminder INDEX`

- `INDEX` refers to the index number shown in the displayed list when [`reminderlist`](#view-reminder-list-reminderlist) command is used.

Example of usage: `markreminder 1`

Example output:
```
You have marked Reminder
Type: debt
Date: 2023.12.11
Status: Done
```

### View Goal List: `wishlist`
View your current goal list with goals that you have added.

Format: `wishlist`

Example of usage: `wishlist`

Example of output:
```
Here is your wish list:
1. Goal
Label: car
Amount: 5000
Status: Not Achieved
2. Goal
Label: ipad
Amount: 2000
Status: Not Achieved
```

### Set goal: `set goal`
Adds a goal to the Financial Planner.

Format: `set goal /g GOAL /l LABEL`
- `/g` is used to specify the goal amount.
- `/l` is used to give a label to the goal.

Example of usage: `set goal /g 5000 /l car`

Example output:
```
You have added Goal
Label: car
Amount: 5000
Status: Not Achieved
```

### Delete goal: `deletegoal`
Deletes a goal from the Financial Planner.

Format: `deletegoal INDEX`
- `INDEX` refers to the index number shown in the displayed list when [`wishlist`](#view-goal-list-wishlist) command is used.

Example of usage: `deletegoal 1`

Example output:
```
You have deleted Goal
Label: car
Amount: 5000
Status: Not Achieved
```

### Mark goal as achieved: `markgoal`
Marks a goal as achieved in the Financial Planner. This operation will automatically create a corresponding expense.

Format: `markgoal INDEX`
- `INDEX` refers to the index number shown in the displayed list when [`wishlist`](#view-goal-list-wishlist) command is used.

Example of usage: `markgoal 1`

Example output:
```
You have achieved Goal
Label: ipad
Amount: 2000
Status: Achieved
Congratulations!
You have added an Expense
Type: Others
Amount: 2000.00
Description: ipad
to the Financial Planner.
Balance: -2000.00
```

### Visualizing your cashflow: `vis`

Using this command to visualize your income or expenses in a pie chart, bar chart or radar chart
Expand Down
31 changes: 0 additions & 31 deletions docs/diagrams/AddCashflowSequence.puml

This file was deleted.

28 changes: 0 additions & 28 deletions docs/diagrams/CashflowClassDiagram.puml

This file was deleted.

Loading

0 comments on commit d95af1b

Please sign in to comment.