PROJECT: Personal Finance Tracker


Overview

This portfolio aims to document the contributions made by Lim Jiahui to the Personal Finance Tracker.

Personal Finance Tracker is a desktop finance tracker application used for tracking personal finances such as daily expenses, recurring expenses such as monthly electricity bills, budgets and debts owed to another party. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 30 kLoC. The product was morphed from an Address Book over a period of 8 weeks under the constraints described here.

Summary of contributions

  • Major enhancement: added the feature that lets users manage their budgets in the finance tracker application

    • What it does: allows the user to add, edit, delete, select and clear all budgets while helping the user to keep track of how much the user has spent for each category of budget. Integrated to work with current undo/redo and history commands.

    • Justification: This feature improves the product significantly because it is now simpler for a user to track how much they are spending relative to how much they allocate to a particular category.

    • Highlights: The implementation of this feature required making significant changes to existing codes, and integrating them together. It provides a platform for any future enhancements to the finance tracker like the ability to add a recurring budget.

  • Code contributed: [code collated by reposense]

  • Other contributions:

    • Project management:

      • Reviewed pull requests of team mates

      • Consolidated tasks during meeting for easier reference in future

    • Documentation:

      • Added user stories and use cases to Developer Guide (Pull requests #28 and #55)

      • Checked through Developer Guide and made any necessary changes (Pull request #222)

    • Enhancements to existing features:

      • Added validation checks for Date class (Pull request #175)

      • Added clear command for budgets, debts and recurring expenses (Pull request #201)

      • Updated history command to display only valid commands (Pull request #222)

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Adding a budget : addbudget

Adds a budget with a time frame to the tracker.
Format: addbudget $/AMOUNT c/CATEGORY [sd/START_DATE] ed/END_DATE [r/REMARKS]
Shortcut: ab $/AMOUNT c/CATEGORY [sd/START_DATE] ed/END_DATE [r/REMARKS]

  • The categories include: FOOD, TRANSPORT, SHOPPING, WORK, UTILITIES, HEALTHCARE, ENTERTAINMENT, TRAVEL, OTHERS which are case insensitive.

  • The program only limits one budget for each category.

  • START_DATE and END_DATE must be in dd-mm-yyyy format.

  • If START_DATE is omitted, current date will be used.

Examples:

  • addbudget c/food $/400 sd/01-02-2019 ed/28-02-2019

  • ab c/others $/12000 sd/01-01-2019 ed/31-12-2019

Editing a budget: editbudget

Edits a budget in the finance tracker.
Format: editbudget c/CATEGORY [$/AMOUNT] [sd/NEW_START_DATE] [ed/NEW_END_DATE]
Shortcut: eb c/CATEGORY [$/AMOUNT] [sd/NEW_START_DATE] [ed/NEW_END_DATE]

  • Edits the budget of the specified CATEGORY.

  • At least one of the optional fields must be provided.

  • Existing values will be updated to the input values.

Examples:

  • editbudget c/food ed/31-03-2019

  • eb c/others $/5000 sd/01-01-2019 ed/31-03-2019

Deleting a budget: deletebudget

Deletes a budget from the finance tracker.

  • Deletes the budget of the specified CATEGORY.

Format: deletebudget c/CATEGORY
Shortcut: db c/CATEGORY

Examples:

  • deletebudget c/food

Selecting a budget: selectbudget

Selects a budget in the finance tracker.

  • Selects the budget of the specified CATEGORY.

Format: selectbudget c/CATEGORY
Shortcut: sb c/CATEGORY

Examples:

  • selectbudget c/work

Clearing all budgets: clearbudget

Clears all budgets from the finance tracker.
Format: clearbudget
Shortcut: cb

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Budget Feature

This feature allows users to set budgets for different categories so they can limit the amount spent for each category.

It stores all budgets added by the user and keeps track of the expenses added within the user-specified time frame.

This feature includes addbudget, editbudget, deletebudget, selectbudget and clearbudget.

The implementation of the budget feature is under the Logic and Model components.

Current implementation

Adding a budget:

User enters the command word addbudget, followed by the category for which they want to set the budget for, the amount they want to limit themselves to for that category and specifies the start and end date for that budget.

Editing an existing budget:

User enters the command word editbudget, followed by the category for which they want to edit the budget of and the relevant parameters of which they wish to edit the values of.

Deleting an existing budget:

User enters the command word deletebudget, followed by the category for which they wish to delete the budget for.

Selecting an existing budget:

User enters the command word selectbudget, followed by the category for which they wish to select the budget for viewing.

For all four actions, the user command gets parsed by the respective parsers: AddBudgetCommandParser, EditBudgetCommandParser, DeleteBudgetCommandParser and SelectBudgetCommandParser, which handle the execution of the commands.

Below is the UML sequence diagram of a scenario for the addbudget command. Editing, deleting and selecting budgets work similarly to adding budgets.

AddBudgetSequenceDiagram
  1. User enters the command addbudget c/food $/1000 ed/30-06-2019, to add a new budget for the FOOD category. This command is executed by LogicManager, which calls FinanceTrackerParser#parseCommand("addbudget c/food $/1000 ed/30-06-2019"). This creates a new AddBudgetCommandParser object which will help parse the input by the user.

  2. The newly created object calls parse("c/food $/1000 ed/30-06-2019") which in turn calls ArgumentTokenizer#tokenize("c/food $/1000 ed/30-06-2019", "/c", "$/", "sd/", "ed/", "r/") to split the arguments into the different parameters of a budget. This returns an argMultiMap containing the split input.

  3. The AddBudgetCommandParser object then calls ParserUtil#parseCategory(argMultiMap.getValue("c/").get()) ParserUtil#parseAmount(argMultiMap.getValue("$/").get()) and ParserUtil#parseDate(argMultiMap.getValue("ed/").get()) to parse the arguments provided by the user into the correct formats of the relevant parameters. As the user does not specify a start date in this case, the programme will use the local date on the system’s clock. An AddBudgetCommand object containing the parameter values provided and today’s date as the start date is then created and returned to the LogicManager.

  4. The LogicManager calls AddBudgetCommand#execute(), which will call Model#updateFilteredBudgetList(Predicate<Budget>) to update the list of budgets stored in the finance tracker.

  5. Model#addBudget(budget) is then called to add the budget into the budget list.

  6. The command result is then returned to the LogicManager which then returns it to the UI where the changes are then reflected on the user interface.

Updating of budgets:
  • When a new budget is added, the model checks the expense list for any expenses of that category which fall within the time frame of the added budget and sets the totalSpent and percentage variables of the Budget object accordingly.

  • When an existing budget is edited, the model updates the percentage variable of the Budget object.

  • For every expense the user enters, the model will check if there exists a budget for the category of the added expense and if the date of the expense is within the time frame of the budget. If the added expense is during the time of the budget, the totalSpent variable in the Budget object with that specific category will be updated.

  • The total amount spent for each budget category, along with the percentage of the total budgeted amount, will be displayed to the user so that the user can know how much has been spent so far and can better plan their future expenses so as not to exceed their budget.

Future Enhancements

The Budget class has a boolean method overlaps(Budget other) which returns true if two budgets of the same category have overlapping time frames. This method was included with the idea of allowing the user to add multiple budgets for the same category but for different time frames.

Another future enhancement would be to notify the user when a certain budget is about to exceed. For example, if the percentage spent within the time frame reaches say 90% of the budget amount, the user will receive an e-mail or notification of some sort to alert the user. Another notification can also be sent when the budget is actually exceeded.

Yet another possible enhancement would be to allow the user to set a recurring budget. For example, if a user wants to limit their daily spending to $20, maybe an addrecurringbudget c/food $/20 f/d command, similar to the recurring expense command, could be implemented so that the user does not have to add a budget everyday.

Appendix A: Product Scope

Target user profile:

  • has a need to manage a significant number of expenses, debts and bills/subscriptions

  • wants to keep track of how much is being spent

  • prefer desktop apps over other types

  • can type fast

  • prefers typing over mouse input

  • is reasonably comfortable using CLI apps

Value proposition: manage finances faster than a typical mouse/GUI driven app

Appendix B: User Stories

Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *

Priority As a/an …​ I want to …​ So that I can…​

* * *

new user

see usage instructions

refer to instructions when I forget how to use the App

* *

user

view a list of my expenses in certain time periods

have a better overview of my expenses

* * *

user

add expenses into the finance tracker

record all my expenses

* * *

user

see the total amount of money I have

see how much money I have left overall and better plan my finances

* * *

user

make changes to expenses I previously added

correct any mistakes

* * *

organised user

categorise my expenses

know my spending for each category

* * *

user

delete an expense

remove entries that I no longer need to keep track of

* * *

thrifty user

set a budget

manage my expenses and see how much more I can spend for the remaining part of the day/week/month/year

* *

user

split my budget into different categories

enhance my finance planning further and not spend excessively on a single category, e.g. food

* * *

user

edit my budget

change the amount of budget available or the duration

* * *

user

cancel my budget

* *

user

view a list of my debts and see when they are due

remind myself to pay the people I owe by their due dates

* * *

forgetful user

add my debts

can see who I owe money to

* * *

user

edit my debts

change the amount I owe if any changes occur

* * *

user

delete my debts

* * *

user

clear my paid debts

know I have settled them

* * *

user

add my recurring expenses

keep track of my subscriptions and bills

* * *

user

edit my recurring expenses

change the details of my bills if any changes occur

* * *

user

delete my recurring expenses

* * *

analytical user

see a breakdown of my expenses

know what I spend the most on

* *

visual user

have charts and graphs to represent my expenditure

have a better picture on the different categories of my expenses

* *

efficient user

be able to view my command history

easily input a repeated command when needed

* * *

user

undo and redo my actions

* * *

user

clear all entries

start with an empty finance tracker again when needed

* *

non-tech-savvy user

type simple commands step by step

use the programme more easily without having to keep referring to the help menu

*

user

receive reminders regarding my expenditure

know if my spending is about to exceed my budget or when my debts are about to be due

Appendix C: Use Cases

(For all use cases below, the System is the Personal Finance Tracker (PFT) and the Actor is the user, unless specified otherwise)

Use case 1: List expenses

MSS

  1. User chooses to list all expenses and specifies if user wants to view by specific duration or category

  2. PFT displays all expenses according to specified duration or category

    Use case ends.

Extensions:

  • 1a. PFT detects invalid value for view

    • 1a1. PFT informs user that input is invalid

    • Use case ends.

Use case 2: Add expense

MSS

  1. User chooses to add an expense

  2. PFT prompts user for name of expense

  3. User enters name

  4. PFT prompts user for amount for expense

  5. User enters amount

  6. PFT prompts user for date of expense

  7. User enters date

  8. PFT prompts user for remark of expense

  9. User enters remark

  10. PFT creates expense and displays confirmation

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 10.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9)a. PFT detects wrong format or incorrect data

    • 3(5,7,9)a1. PFT requests for correct format

    • 3(5,7,9)a2. User enters correct data

    • Use case resumes from step 4(6,8,10)

Use case 3: Edit expense

MSS

  1. User chooses to edit an existing expense by specifying its index

  2. PFT prompts user for new name of expense

  3. User enters new name

  4. PFT prompts user for new amount of expense

  5. User enters new amount

  6. PFT prompts user for new category of expense

  7. User enters new category

  8. PFT prompts user for new date of expense

  9. User enters new date

  10. PFT prompts user for new remark for expense

  11. User enters new remark

  12. PFT updates the existing values to the values entered by user

    Use case ends

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 12.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9,11)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11)a1. PFT requests for correct format

    • 3(5,7,9,11)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12)

Use case 4: Delete expense

MSS

  1. User chooses to delete an existing expense and specifies its index

  2. PFT deletes the expense at the specified index

    Use case ends.

Extensions:

  • 1a. PFT detects that index is invalid.

    • 1a1. PFT informs user that index is invalid.

    • Use case ends.

Use case 5: Add budget

MSS

  1. User chooses to add a budget

  2. PFT prompts user for category of budget

  3. User enters category

  4. PFT prompts user for amount for budget

  5. User enters amount

  6. PFT prompts user for start date of budget

  7. User enters start date

  8. PFT prompts user for end date of budget

  9. User enters end date

  10. PFT creates budget for specified time frame

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 10.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user that command is invalid

    • Use case ends.

  • 3(5,7,9)a. PFT detects wrong format or incorrect data

    • 3(5,7,9)a1. PFT requests for correct format

    • 3(5,7,9)a2. User enters correct data

    • Use case resumes from step 4(6,8,10).

Use case 6: Edit budget

MSS

  1. User chooses to edit an existing budget

  2. PFT prompts user for category to edit budget for

  3. User enters category

  4. PFT prompts user for new amount for budget

  5. User enters new amount

  6. PFT prompts user for new start date of budget

  7. User enters new start date

  8. PFT prompts user for new end date of budget

  9. User enters new end date

  10. PFT updates the existing values to the values entered by user

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 10.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9)a. PFT detects wrong format or incorrect data

    • 3(5,7,9)a1. PFT requests for correct format

    • 3(5,7,9)a2. User enters correct data

    • Use case resumes from step 4(6,8,10).

Use case 7: Delete budget

MSS

  1. User chooses to delete an existing budget and specifies its category

  2. PFT deletes the budget for the specified category

    Use case ends.

Extensions:

  • 1a. PFT detects invalid category

    • 1a1. PFT informs user that category is invalid

    • Use case ends.

Use case 8: List debt

MSS

  1. User chooses to list debts

  2. PFT lists debts

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 2

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

Use case 9: Add debt

MSS

  1. User chooses to add a debt

  2. PFT prompts user for expense owed for debt

  3. User enters name

  4. PFT prompts user for amount owed of debt

  5. User enters amount

  6. PFT prompts user for category of debt

  7. User enters category

  8. PFT prompts user for deadline of debt

  9. User enters deadline

  10. PFT prompts user for remark of debt

  11. User enters remark

  12. PFT creates budget for specified time frame

    Use case ends

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 12.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9,11)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11)a1. PFT requests for correct format

    • 3(5,7,9,11)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12).

Use case 10: Edit budget

MSS

  1. User chooses to edit an existing debt

  2. PFT prompts user for new expense owed for debt

  3. User enters new name

  4. PFT prompts user for new amount for debt

  5. User enters new amount

  6. PFT prompts user for new category for debt

  7. User enters new category

  8. PFT prompts user for new end deadline for debt

  9. User enters new deadline

  10. PFT prompts user for new remark of debt

  11. User enters new remark

  12. PFT updates the existing values to the values entered by user

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 12.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9,11)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11)a1. PFT requests for correct format

    • 3(5,7,9,11)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12).

Use case 11: Delete debt

MSS

  1. User chooses to delete an existing debt and specifies its index

  2. PFT deletes the debt at the specified index

    Use case ends.

Extensions:

  • 1a. PFT detects invalid index

    • 1a1. PFT informs user that index is invalid

    • Use case ends.

Use case 12: Pay debt

MSS

  1. User chooses to pay off an existing debt and specifies its index

  2. PFT converts the debt into an expense entry

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 2.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

Use case 13: Add recurring expense

MSS

  1. User chooses to add recurring expense

  2. PFT prompts user for name of recurring expense

  3. User enters name

  4. PFT prompts user for amount of recurring expense

  5. User enters amount

  6. PFT prompts user for category of recurring expense

  7. User enters category

  8. PFT prompts user for frequency of recurring expense

  9. User enters frequency

  10. PFT prompts user for number of occurrences of recurring expense

  11. User enters number of occurrences

  12. PFT prompts user for start date of recurring expence

  13. User enters start date

  14. PFT prompts user for remark of recurring expense

  15. User enters remark

  16. PFT creates recurring expense and displays confirmation

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 16.

  • 1b. User enters complex command with missing parameters

    • Use case ends.

  • 3(5,7,9,11,13,15)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11,13,15)a1. PFT requests for correct format

    • 3(5,7,9,11,13,15)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12,14,16).

Use case 14: Edit recurring expense

MSS

  1. User chooses to edit existing recurring expense

  2. PFT prompts user for new name of recurring expense

  3. User enters new name

  4. PFT prompts user for new amount of recurring expense

  5. User enters new amount

  6. PFT prompts user for new category of recurring expense

  7. User enters new category

  8. PFT prompts user for new frequency of recurring expense

  9. User enters new frequency

  10. PFT prompts user for new number of occurrences of recurring expense

  11. User enters new number of occurrences

  12. PFT prompts user for new start date of recurring expense

  13. User enters new start date

  14. PFT prompts user for new remark of recurring expense

  15. User enters new remark

  16. PFT updates parameters with new values

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 16.

  • 1b. User enters complex command with missing parameters

    • Use case ends.

  • 3(5,7,9,11,13,15)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11,13,15)a1. PFT requests for correct format

    • 3(5,7,9,11,13,15)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12,14,16).

Use case 15: Delete recurring expense

MSS

  1. User chooses to delete existing recurring expense and specifies both its index and whether to delete all old expenses already added by this recurring expense

  2. PFT deletes the recurring expense at the specified index

    Use case ends.

Extensions:

  • 1a. PFT detects invalid index.

    • 1a1. PFT informs user that index is invalid

    • Use case ends.

  • 1b. User enters command with missing or invalid parameters

    • 1b1. PFT informs user of invalid input.

    • Use case ends.

Use case 16: View statistics summary

MSS

  1. User chooses to view statistics

  2. PFT prompts user for start date

  3. User enters start date

  4. PFT prompts user for end date

  5. User enters end date

  6. PFT prompts user for visual representation method

  7. User enters visual representation method

  8. PFT displays the statistics requested

    Use case ends

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 8

  • 1b. User enters complex command with missing parameters

    • 1b1. Use case ends

  • 3(5)a. PFT detects wrong format or incorrect data

    • 3(5)a1. PFT requests for correct format

    • 3(5)a2. User enters correct data

    • Use case resumes from step 4(6)

Use case 17: View statistics trend

MSS

  1. User chooses to view statistics trend

  2. PFT prompts user for start date

  3. User enters start date

  4. PFT prompts user for end date

  5. User enters end date

  6. PFT prompts user for period

  7. User enters period

  8. PFT displays the statistics requested

    Use case ends

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 8.

  • 1b. User enters complex command with missing parameters

    • Use case ends.

  • 3(5,7)a. PFT detects wrong format or incorrect data

    • 3(5,7)a1. PFT requests for correct format

    • 3(5,7)a2. User enters correct data

    • Use case resumes from step 4(6,8).

Use case 18: Compare 2 statistic summaries

MSS

  1. User chooses to compare statistics

  2. PFT prompts user for date 1

  3. User enters date

  4. PFT prompts user for date 2

  5. User enters date

  6. PFT prompts user for period

  7. User enters period

  8. PFT displays the statistics requested

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 8.

  • 1b. User enters complex command with missing parameters

    • Use case ends.

  • 3(5,7)a. PFT detects wrong format or incorrect data

    • 3(5,7)a1. PFT requests for correct format

    • 3(5,7)a2. User enters correct data

    • Use case resumes from step 4(6,8)

Use case 19: View command history

MSS

  1. User chooses to view command history

  2. PFT lists all valid commands entered in reverse chronological order

    Use case ends.

Use case 20: Auto-fill previous command

MSS

  1. User keys in “Up” arrow

  2. PFT auto-fills previous command stored in history in the command line

    Steps 1-2 can be repeated as many times as required until the command wanted is reached

  3. User presses enter

  4. PFT executes autofilled command

    Use case ends.

Extensions:

  • 2a. User realises user has accidentally pressed "Up" arrow too many times

    • 2a1. User presses "Down" arrow

    • 2a2. PFT auto-fills next command stored in history in the command line

    • Steps 2a1-2a2 can be repeated as many times as required until the command wanted is reached

    • Use case resumes from step 3.

Use case 21: Undo previous command

MSS

  1. User chooses to undo previous command

  2. PFT restores itself to the state before the previous undoable command

Extensions:

  • 1a. PFT does not find any undoable command

    • 1a1. PFT informs user that there are no undoable commands executed previously

      Use case ends.

Use case 22: Clear all entries

MSS

  1. User chooses to clear all entries stored

  2. PFT requests for confirmation

  3. User enters confirmation

  4. PFT deletes all entries

    Use case ends.

Use case 23: Exit programme

MSS

  1. User chooses to exit

  2. PFT closes itself and exits

    Use case ends.