FinanceIt is an all-in-one desktop application that handles the finance tracking needs of university students who are
comfortable with a CLI interface. In the application, it consists of 5 sub-application that helps student to manage
their finance.
-
Project Management
- Managed releases
v1.0
-v-2.0
on GitHub (2 releases)
- Managed releases
-
Contributions to the project on RepoSense.
- Code contributed: RepoSense Link
-
Contributions to TP repository
-
Report and maintenance of project issues and milestones
-
Pull Requests to TP for code contribution
-
FinanceIt is an all-in-one desktop application that handles the finance tracking needs of university students who are comfortable with a CLI interface. It includes 5 different finance tools, all of which take in typed commands from the users to execute their respective functions.
- Table of Contents {:toc}
Prerequisites: A computer
- Download the executable from our latest release .
- Save the executable file in your preferred folder.
- Run the program via the command line. The command is:
java -jar financeit.jar
.
Prerequisites: JDK 11, update Intellij to the most recent version.
- Download the latest release from the release page.
- Open Intellij (if you are not in the welcome screen, click
File
>Close Project
to close the existing project dialog first) - Set up the correct JDK version, as follows:
- Click
Configure
>Structure for New Projects
and thenProject Settings
>Project
>Project SDK
- If JDK 11 is listed in the drop down, select it. If it is not, click
New...
and select the directory where you installed JDK 11 - Click
OK
- Click
- Import the project into Intellij as follows:
- Click
Open or Import
. - Select the project directory, and click
OK
- If there are any further prompts, accept the defaults.
- Click
- After the importing is complete, locate the
src/main/java/seedu.financeit/Financeit.java
file, right-click it, and chooseRun Financeit.main()
. If the setup is correct, you should see something like the below:
Output:
Feature | Command | Description |
---|---|---|
Manual Tracker | manual |
Manual entry of transactions. In Manual Tracker, the user manages daily lists of entries called Ledgers. |
Entry Tracker | entry |
Subsidiary subroutine of Manual Tracker. In Entry Tracker, the user manages ledger entries, which represents a unit of transaction for a particular day. |
Recurring Tracker | recur |
In recurring Tracker, the user manages special recurring entries that are deducted on a regular basis, which are too cumbersome to record regularly with Entry Tracker. |
Goal Tracker | goal |
Sets income or expense goals, whereby the tracker will report to user his progress towards them whenever an entry is added. |
Save Manager | saver |
Allows save of multiple program running states and load them anytime you want. May also delete and reset running state. |
Finance Tools | finance |
FinanceTools contains tools related to financial calculations. |
Gateway to the various other features of the application. Upon running the application, you should be greeted by the main menu. Enter the corresponsing commands shown on the table to visit the desired feature!
Feature | Command |
---|---|
Manual Tracker | manual |
Entry Tracker | entry |
Recurring Tracker | recur |
Goal Tracker | goal |
Save Manager | saver |
Finance Tools | financial |
Quit | quit |
Exits from the program. If you have an outstanding list, it will be saved automatically as lastSave.txt in the saveStates folder. This folder will be automatically created when you first run the program.
Syntax
exit
Example:
Users can manage lists of entries, which are known as ledgers. Each list represents a single date of record.
Example If I wish to record my income and expenditures on 30 October 2020, I will use the program as follows: 1. Use Manual Tracker to create a ledger of date 20-10-03 2. Open the ledger of date 20-10-03 3. Use Entry Tracker to create entries to record the transactions for that particular date
Add a ledger to the record, representing a date.
Syntax
new {PARAM_TYPE} {PARAM}
Param Type | Param | Param Format |
---|---|---|
/date |
Date of the ledger, and all the entries under that ledger. | Input string of the date in YYMMDD, YY-MM-DD or YY-M-D |
Example:
Remove a specified ledger from the record, referenced by date or id on the list.
This means that the user only need to specify one of the two param types, either /date
or /id
.
Syntax
delete {PARAM_TYPE} {PARAM}
Param Type | Param | Param Format |
---|---|---|
/date |
Date of the ledger, and all the entries under that ledger. | Input string of the date in YYMMDD, YY-MM-DD or YY-M-D |
/id |
Index of the ledger in the list, where the first ledger is of index 1. | Input positive integer |
Example:
Users will gain access into the entries associated with the specified ledger, referenced by date or id on the list.
This means that the user only need to specify one of the two param types, either /date
or /id
.
- Automatic creation of non-existing ledgers
- If the ledger specified do not exist and if the param type supplied is "/date", the program will create a new ledger in accordance to the date supplied.
- If the user specifies a non-existing index, then the program will not have enough information to create the new ledger instance. Automatic creation will not apply in this particular case.
Refer to Feature Entry Tracker onwards for further instructions.
Syntax
open {PARAM_TYPE} {PARAM}
Param Type | Param | Param Format |
---|---|---|
/date |
Date of the ledger, and all the entries under that ledger. | Input string of the date in YYMMDD, YY-MM-DD or YY-M-D |
/id |
Index of the ledger in the list, where the first ledger is of index 1. | Input positive integer |
Example:
Shows the record of ledgers that has been added.
Syntax
list
Example:
Prints available commands that users can enter in for manualTracker.
Syntax
commands
Example:
Exit to main menu where users can choose another feature to use.
Syntax
exit
Example:
Subroutine that is subsidiary off the ManualTracker. Users can manage entries associated with the ledger they have opened. Entries are specified by the following parameters:
- Time of transaction
- Time in which the transaction ocurred
- Type of transaction
- Income or Expense
- Category of transaction. The user is only limited to the following set of categories.
- Income: {Salary, Allowance, Others}
- Expense: {Transport, Food, Travel, Shopping, Bills, Others}
- Amount
- Amount involved in the transaction.
- If the transaction type is expense, the amount is considered as a deduction to the account.
- If the transaction type is income, the amount is considered as a credit to the account.
- Amount involved in the transaction.
- Description
- User input texts to help them record the details of the transaction.
Example
Ledger of date 20-10-03
Entry 1: Shopping at MBS : $1500
Entry 2: Salary : $3000
From the above, we can infer that on the date 20-10-03, the user has one expense entry and one income entry.
Add an entry to the ledger record.
Note:
- For transaction categories, we require the users to enter the shortcut equivalent to the categories listed above. Refer to the following table.
Category | Category shortcut | Compatible transaction type |
---|---|---|
FOOD | fd | Expense |
BILLS | bll | Expense |
TRANSPORT | tpt | Expense |
TRAVEL | tvl | Expense |
SALARY | slr | Expense |
ALLOWANCE | alw | Income |
OTHERS | oth | Income |
Syntax
new {PARAM_TYPE} {PARAM}
Param Type | Param | Param Format |
---|---|---|
/time |
Time of the entry. | Input string of the date in HHMM, HHMMSS or H. |
/amt |
Amount involved in the transaction. | Input positive floating point number in 2 d.p. Can be $XX.XX, XX, etc. |
/cat |
Category of transaction. | Input string belonging in the set: {tpt, fd, tvl, shp, bll, slr, alw} |
-i or -e |
Type of transaction. | No parameter required. |
Example:
Add an entry to the ledger record. Users only need specify the param to edit, there is no need to fill out all params.
Note
- While the index is compulsory to be provided, the rest of the params are not compulsory. The users will include the params that they wish to modify.
- Hence, a sample command
entry edit /id 1 /time 1600
will modify entry at index 1 to time 1600.
Syntax
edit /id {INDEX} {PARAM_TYPE} {PARAM} ...
Param Type | Param | Param Format |
---|---|---|
/id |
Index of the entry in the list, where the first entry is of index 1. | Input positive integer |
/time |
Time of the entry. | Input string of the date in HHMM, HHMMSS or H. |
/amt |
Amount involved in the transaction. | Input positive floating point number in 2 d.p. Can be $XX.XX, XX, etc. |
/cat |
Category of transaction. | Input string belonging in the set: {tpt, fd, tvl, shp, bll, slr, alw} |
-i or -e |
Type of transaction. | No parameter required. |
Example:
Remove a specified entry from the record, referenced by id on the list.
Syntax
delete {PARAM_TYPE} {PARAM}
Param Type | Param | Param Format |
---|---|---|
/time |
Time of the entry. | Input string of the date in HHMM, HHMMSS or H. |
/id |
Index of the entry in the list, where the first entry is of index 1. | Input positive integer |
Example:
Shows the record of entries that has been added.
Syntax
list
Example:
Prints available commands that users can enter in for manualTracker.
Syntax
commands
Example:
Prints expenditure category shortcuts that the user can input in entry creation/ edit commands.
Syntax
cat
Example:
Exit to Manual tracker where users can choose another ledger.
Syntax
exit
Example:
No. | Feature | Syntax |
---|---|---|
1. | Open Ledger | open /date {YYMMDD} or delete /id {INDEX} |
2. | New Ledger | new /date {YYMMDD} |
3. | List Ledgers | list |
4. | Delete Ledgers | delete /date {YYMMDD} or delete /id {INDEX} |
5. | Exit to Main Menu | exit |
Architecture Diagram
There are 5 distinct features that exists within the FinanceIt application, all of which are accessed via the main menu interface facilitated in FinanceIt.java.
The design of the software can be split into 5 distinct components:
- Logic Manager component
- Logic component
- Input Manager component
- Data component
- Storage component
Description
The Logic Manager component serves as the bridge between user interface and program operations.
It includes 5 classes:
ManualTracker
EntryTracker
RecurringTracker
GoalTracker
FinanceTools
API
ManualTracker
,RecurringTracker
andEntryTracker
maintains an instance of aDataList
(LedgerList
andEntryList
) inModel
respectively, and provides an interface for the user can append, remove or perform otherData
operations with the contents of theDatalist
.GoalTracker
maintains a list of income or expenseGoals
to track against entries in theEntryList
, and provides an interface for the user to append or removeGoals
.Finance Tools
class provides an interface for users to utilize an array of finance calculator tools within it.- All
LogicManager
classes use theInputManager
component to process user input, then useLogic
component to perform the operation associated with the param handling.
Description
The Logic Component executes logic operations passed via a CommandPacket
, by handling individual params
contained in the CommandPacket
.
API
- Different
CommandHandler
classes are used inLogicManager
classes to handle various operations e.g. new, edit, delete - If
CommandHandler
classes recognises aparam
from theCommandPacket
instance, it performs a sub-operation associated with theparam
. For instance,/date
will causeCreateLedgerCommand
instance to set the date of the newly created ledger. CommandHandler
in turn usesParamChecker
to verify validity of inputs before setting.
- Note: Refer to Input Manager Component above for class diagram illustration of the below subsections.
Input Conventions
- The user input is composed of the following format:
<command> <param type> <parameter> <param type> <parameter> ...
-
The
command
string determines the current state of the Finite State Machine, and hence the function executed. -
The remainder of the string includes a series of
param type
-param
combinations, wherebyparam type
indicates the type of the parameter which is to be identified by the user class, andparam
indicates the parameter that is associated with theparam type
. -
Param types are restricted to two types:
/<string>
, requires a corresponding parameter.- Eg.
param type
:/date
param
:2020-04-04
- Eg.
-<string>
, does not require a corresponding parameter.- Reserved for param types which are used to specify a property to be true/false
- Eg.
-auto
, to specify if an entry has automatic deduction.
- A helper class. Contains two particular attributes to store the user input in an organised fashion.
commandString
:String
Store the command string from the input.paramMap
:HashMap
Store the pairs ofparam type
andparam
present in the input string.- Key:
param type
- Value:
param
- Key:
InputParser class
- A helper class. Parses the input string and returns a corresponding
commandPacket
.parseInput()
:- Initializes a
commandPacket
and populates thecommandString
attribute. - Calls ParamParser instance to parse the segment of the input string
that corresponds with the sequence of
param type
-param
pairs, and return a HashMap populated with the aforementioned pairs. - Returns a fully populated
commandPacket
to be used by user classes.
- Initializes a
ParamsParser class
- A helper class. Parses the subsequence of the input string that corresponds with sequence of
param type
-param
pairs.- Parsing of input for params via
parseParams()
:-
Step 1: Use a regex helper class
RegexMatcher
to identify and extractparam type
that matches the pattern specified in "Input conventions":- Param types are restricted to two types:
/abcd
, requires a corresponding parameter.- Example:
param type:/date
, param:2020-04-04
- Example:
-abcd
, does not require a corresponding parameter.- Reserved for param types which are used to specify a property to be true/false
- Example:
-auto
, to specify if an entry has automatic deduction.
- Param types are restricted to two types:
-
Step 2: Identify the substring of the rest of the input string before the next
param type
or end-of-line, as theparam
to the previously identifiedparam type
. Extract it from the input string. -
Step 3: Put the
param type
-param
pair into aHashMap
. -
Step 4: Repeat steps 1 to 4 until there is the input string is fully extracted.
-
Step 5: Return a
HashMap
populated with the aforementioned pairs.
-
- Parsing of input for params via
- Loading up user data
- Access to various features
- Saving outstanding user data to respective save files
Overview
Ledgers and Entries
In this feature, we represent the transactions incurred by the users as Entry
instances.
Instances of Entry
class are categorised by the date of origin, which is represented by
Ledger
instances.
Entry
instances are characterized by the following:
- Time of transaction
- Type of transaction: Income/ Expense
- Amount in transaction
- Category of spending/ expenditure
- Description
Ledger
instances are characterized by the following:
- Time of transaction
- Collection of
Entry
instances
Manual Tracker
The Manual Tracker is a feature that allows users to manage Ledgers with create, delete and open operations. Ledgers is a class that maintains a list of transactions that are recorded for a given date.
The Entry Tracker is fundamentally similar to the Manual Tracker, except it manages Entry
instances
instead of Ledger
. Entry Tracker is initialized when a Ledger
instance is "opened", whereby
the Entry Tracker facilitate the manipulation of the collection of Entry
instances that are associated with
that particular Ledger
instance.
For the sake of brevity, this section will focus on the discussion of the Manual Tracker. The edit operation of the Entry Tracker will be discussed at the end of this section; it is sufficiently unique to Manual Tracker operations to merit detailed discussion.
The Manual Tracker is capable of executing the following states of operation:
States | Operations |
---|---|
MAIN_MENU |
Go to main menu for users to choose the available operations |
CREATE_LEDGER |
Create a ledger specified by date, and append it to ledgerList . |
DELETE_LEDGER |
Delete an existing ledger, referenced by date or index. |
OPEN_LEDGER |
Go to subroutine "Entry Tracker" for the entries recorded under the specified ledger. |
Architecture in Context
Logic Manager and Parser
Class | Function |
---|---|
InputParser |
Breaks input string by user into commandString and a sequence of paramTypes -param pairs. The latter subsequence of the string is passed into ParamParser for further processing. Information obtained from input parsing will be used to populate an instantiated CommandPacket instance, which will then be passed to the entity that called the parsing function. |
ParamParser |
Process the sequence of paramTypes -param pairs and populate the paramMap in the instantiated CommandPacket instance. |
ManualTracker |
Refer to section. |
EntryTracker |
Omitted for brevity. |
Class | Function |
---|---|
ManualTracker |
Refer to section. |
EntryTracker |
Omitted for brevity. |
EntryList |
Omitted for brevity. |
Entry |
Omitted for brevity. |
LedgerList |
Extends ItemList. Refer to Ledgers and Entries section for class behavior. |
Ledger |
Extends DateTimeItem. Refer to Ledgers and Entries section for class behavior. |
ItemList |
Class with defined list behavior specified with helper methods such as retrieval, checking of Duplicates and deletion. |
DateTimeItem |
Abstract class that extends Item class; instances will have LocalDate or LocalTime attributes and corresponding helper methods. |
Item |
Abstract class to define behavior of entities that need are stored in ItemList instances. |
Class | Function |
---|---|
RetrieveLedgerHandler |
Process paramTypes -param pairs from the CommandPacket instance to identify specified Ledger instance, then retrieves the instance from the existing LedgerList . |
CreateLedgerHandler |
Process paramTypes -param pairs from the CommandPacket instance to identify specified Ledger instance to be created, then creates the instance and append to existing LedgerList . |
retrieveEntryHandler |
Omitted for brevity. |
CreateEntryHandler |
Omitted for brevity. |
EditEntryHandler |
Omitted for brevity. |
ParamChecker |
Class contains a collection of methods that verify the correctness of the param supplied. For instance, ParamChecker.checkAndReturnIndex checks if the index provided is out of bounds relative to the specified list, and throws the relevant exception if the input index is invalid. |
ParamHandler |
Abstract class that outlines the general param handling behavior of commands instances and other classes that need to handle params in its operation. |
Class | Function |
---|---|
RetrieveLedgerHandler |
Refer to section. |
CreateLedgerHandler |
Refer to section. |
retrieveEntryHandler |
Omitted for brevity. |
CreateEntryHandler |
Omitted for brevity. |
EditEntryHandler |
Omitted for brevity. |
ManualTracker |
Implements Manual Tracker. Contains handler methods that implements a particular operation capable by the Manual Tracker. These methods use the above command instances for param handling operations from user input. |
EntryTracker |
Omitted for brevity. |
Functions with Sequence Diagrams
Creation of Ledger(Sequence Diagram)
-
At
ManualTracker.handleMainMenu()
, the user's input is registered viajava.util.Scanner
instance. -
Input is parsed by
InputParser.parseInput()
, andManualTracker.packet
is set to the returnedCommandPacket
instance. -
The
commandString
of theCommandPacket
instance is evaluated, and the corresponding handle method() is executed.
In this case,handleCreateLedger()
will be called. -
At
handleCreateLedger()
, the following processes will be executed:- A new instance of
CreateLedgerHandler
is created. The input String array will be passed intoCreateLedgerHandler.setRequiredParams()
to set required params for a successful parse. - A new instance of
Ledger
will be instantiated and set toCreateLedgerHandler.currLedger
. CreateLedgerHandler.handlePacket(packet)
is called to handle params in the packet.- Refer to the section on Param Handling for more details pertaining to general param handling.
- For
CreateLedgerHandler
, thehandleSingleParam
abstract method will be implemented as shown in the following table.
- A new instance of
-
From
ManualTracker
, the configuredLedger
instance will be retrieved from theCreateLedgerHandler
instance and added into theLedgerList
instance atManualTracker.ledgerList
.
ParamType | ParamType String | Expected Param | Operation | Verification method |
---|---|---|---|---|
PARAM.DATE |
"/date" | Various format of date in string, eg. "2020-03-02" | Call currLedger.setDate() to set date for the Ledger instance. |
ParamChecker.checkAndReturnDate(packet) |
Deletion of Ledger (Sequence Diagram)
The deletion of a specified ledger is performed in two phases: Ledger Retrieval and Ledger Delete.
- Phase 0: Instruction retrieval
- At
ManualTracker.handleMainMenu()
, the user's input is registered viajava.util.Scanner
instance. - Input is parsed by
InputParser.parseInput()
, andManualTracker.packet
is set to the returnedCommandPacket
instance. - The
commandString
of theCommandPacket
instance is evaluated, and the corresponding handle method() is executed.
In this case,handleDeleteLedger()
will be called.
- At
- Phase 1: Ledger retrieval
- At
handleDeleteLedger()
, the following processes will be executed:- A new instance of
RetrieveLedgerHandler
is created. The input String array will be passed intoCreateLedgerHandler.setRequiredParams()
to set required params for a successful parse. RetrieveledgerHandler.handlePacket(packet)
is called to handle params in the packet.- Refer to the section on Param Handling for more details pertaining to general param handling.
- For
CreateLedgerHandler
, thehandleSingleParam
abstract method will be implemented as shown in the following table:- Note that only one of the two params need to be invoked from the input.
- A new instance of
- At
- Phase 2: Ledger Deletion
- From
ManualTracker
, callledgerList.RemoveItemAtCurrIndex()
to remove the ledger specified by the index set to modify earlier.
- From
ParamType | ParamType String | Expected Param | Operation | Verification method |
---|---|---|---|---|
PARAM.DATE |
"/date" | Various format of date in string, eg. "2020-03-02" | Call ledgerList.setIndexToModify() to set index of retrieved item. |
ParamChecker.checkAndReturnDate(packet) |
PARAM.INDEX |
"/index" | Valid index on the list from 1 onwards. | Call ledgerList.setIndexToModify() to set index of retrieved item. |
ParamChecker.checkAndReturnIndex(packet) |
Entry Tracker: Edit of entries
The editing of details within the entry is performed in two phases: Entry Retrieval and Entry Edit.
- Phase 0: Instruction retrieval
- At
EntryTracker.handleMainMenu()
, the user's input is registered viajava.util.Scanner
instance. - Input is parsed by
InputParser.parseInput()
, andEntryTracker.packet
is set to the returnedCommandPacket
instance. - The
commandString
of theCommandPacket
instance is evaluated, and the corresponding handle method() is executed.
In this case,handleEditEntry()
will be called.
- At
- Phase 1: Entry retrieval(Sequence Diagram)
- At
handleEditEntry()
, the following processes will be executed:- A singleton instance of
RetrieveEntryHandler
is retrieved. The input String array will be passed intoretrieveEntryHandler.setRequiredParams()
to set required params for a successful parse. retrieveEntryHandler.handlePacket(packet)
is called to handle params in the packet.- Refer to the section on Param Handling for more details pertaining to general param handling.
- For
retrieveEntryHandler
, thehandleSingleParam
abstract method will be implemented as shown in the following table. - From
EntryTracker
, callentryList.getItemAtCurrIndex
to retrieve the entry specified by the index set to modify earlier.
- A singleton instance of
- At
ParamType | ParamType String | Expected Param | Operation | Verification method |
---|---|---|---|---|
PARAM.INDEX |
"/index" | Valid index on the list from 1 onwards. |
Call entryList.setIndexToModify() to set index of retrieved item. |
ParamChecker.checkAndReturnIndex(packet) |
- Phase 2: Entry edit (Sequence Diagram)
- Following Phase 1, the following processes will be executed:
- The singleton instance of
EditEntryHandler
is retrieved. There is no need to callEditEntryHandler.setRequiredParams()
; this command does not require params to modify. Instead, it acceps any params supplied and performs the edit accordingly. editeEntryHandler.setPacket(packet)
is called to set packet.
- The singleton instance of
EditEntryHandler.handlePacket()
is called to handle params in the packet.- Refer to the section on Param Handling for more details pertaining to general param handling.
- For
EditEntryHandler
, thehandleSingleParam
abstract method will be implemented as shown in the following table.
- Following Phase 1, the following processes will be executed:
ParamType | ParamType String | Expected Param | Operation | Verification method |
---|---|---|---|---|
PARAM.AMOUNT |
"/amt" | Positive Double in 2 decimal places | Call entryList.setAmount() to set amount |
ParamChecker.checkAndReturnDoubleSigned(packet) |
PARAM.TIME |
"/time" | Various format of time in string, eg. "15:00" | Call entryList.setTime() to set index of retrieved item. |
ParamChecker.checkAndReturnTime(packet) |
PARAM.INC |
"-i" | Income entry type flag | Call entryList.setEntryType(EntryType.INC) to set index of retrieved item. |
nil |
PARAM.EXP |
"-e" | Expense entry type flag | Call entryList.setEntryType(EntryType.EXP) to set index of retrieved item. |
nil |
PARAM.DESCRIPTION |
"/desc" | Description in string, ';' character is illegal. | Call entryList.setDescription() to set index of retrieved item. |
ParamChecker.checkAndReturnDescription(packet) |
PARAM.CATEGORY |
"/cat" | A set of strings that corresponds with entry type | Call entryList.setCategory() to set index of retrieved item. |
ParamChecker.checkAndReturnCategories(packet) |