This project was built on the AddressBook Level-3 as part of a student software engineering project.
Refer to the guide Setting up and getting started.
The documentation uses the terms "client list view" and "transaction list view" to refer to the environment displayed on the UI when the respective list is shown. This table informs you how to switch between these views, which will be useful for later parts of this Developer Guide, such as in some test cases.
Switching between... | Command | Format |
---|---|---|
Client to transaction list view | List Transactions | listt INDEX |
Transaction to client list view | List Clients | list |
The Architecture Diagram given above explains the high-level design of the App.
Given below is a quick overview of main components and how they interact with each other.
Main components of the architecture
Main
(consisting of classes Main
and MainApp
) is in charge of the app launch and shut down.
The bulk of the app's work is done by the following four components:
UI
: The UI of the App.Logic
: The command executor.Model
: Holds the data of the App in memory.Storage
: Reads data from, and writes data to, the hard disk.Commons
represents a collection of classes used by multiple other components.
How the architecture components interact with each other
The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command delete 1
.
Each of the four main components (also shown in the diagram above),
interface
with the same name as the Component.{Component Name}Manager
class (which follows the corresponding API interface
mentioned in the previous point.For example, the Logic
component defines its API in the Logic.java
interface and implements its functionality using the LogicManager.java
class which follows the Logic
interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.
The sections below give more details of each component.
The API of this component is specified in Ui.java
The UI consists of a MainWindow
that is made up of parts e.g.CommandBox
, ResultDisplay
, ClientListPanel
, StatusBarFooter
etc. All these, including the MainWindow
, inherit from the abstract UiPart
class which captures the commonalities between classes that represent parts of the visible GUI.
The UI
component uses the JavaFX UI framework. The layout of these UI parts are defined in matching .fxml
files that are in the src/main/resources/view
folder. For example, the layout of the MainWindow
is specified in MainWindow.fxml
The UI
component,
Logic
component.Model
data so that the UI can be updated with the modified data.Logic
component, because the UI
relies on the Logic
to execute commands.Model
component, as it displays Client
object residing in the Model
.API : Logic.java
Here's a (partial) class diagram of the Logic
component:
The sequence diagram below illustrates the interactions within the Logic
component, taking execute("delete 1")
API call as an example.
Note: The lifeline for DeleteCommandParser
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
How the Logic
component works:
Logic
is called upon to execute a command, it is passed to an AddressBookParser
object which in turn creates a parser that matches the command (e.g., DeleteCommandParser
) and uses it to parse the command.Command
object (more precisely, an object of one of its subclasses e.g., DeleteCommand
) which is executed by the LogicManager
.Model
when it is executed (e.g. to delete a client).Model
) to achieve.CommandResult
object which is returned back from Logic
.Here are the other classes in Logic
(omitted from the class diagram above) that are used for parsing a user command:
How the parsing works:
AddressBookParser
class creates an XYZCommandParser
(XYZ
is a placeholder for the specific command name e.g., AddCommandParser
) which uses the other classes shown above to parse the user command and create a XYZCommand
object (e.g., AddCommand
) which the AddressBookParser
returns back as a Command
object.XYZCommandParser
classes (e.g., AddCommandParser
, DeleteCommandParser
, ...) inherit from the Parser
interface so that they can be treated similarly where possible e.g, during testing.API : Model.java
The Model
component,
Client
objects (which are contained in a UniqueClientList
object).Client
objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Client>
that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.UserPref
object that represents the user’s preferences. This is exposed to the outside as a ReadOnlyUserPref
objects.Model
represents data entities of the domain, they should make sense on their own without depending on other components)Note: An alternative (arguably, a more OOP) model is given below. It has a Tag
list in the AddressBook
, which Client
references. This allows AddressBook
to only require one Tag
object per unique tag, instead of each Client
needing their own Tag
objects. Note that the Transaction
list cannot be refactored in the same way, because all transactions are semantically distinct (e.g two copies of a tag are the same, but two transactions with the same descriptions, amounts, date, and parties are separate because they may simply be two transactions on the same day).
API : Storage.java
The Storage
component,
AddressBookStorage
and UserPrefStorage
, which means it can be treated as either one (if only the functionality of only one is needed).Model
component (because the Storage
component's job is to save/retrieve objects that belong to the Model
)Classes used by multiple components are in the seedu.address.commons
package.
This section describes some noteworthy details on how certain features are implemented.
The execution of the add transaction command creates a new Client
with an updated transaction list consisting of the newly added transaction,
followed by replacing the target Client
in the Model with the newly created client by calling Model#setClient(Client, Client)
.
The following sequence diagram shows an example execution of command addt 1 ...
focusing on interactions within theLogic
component.
Note: The lifeline for AddTransactionCommandParser
should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
The list transactions command allows for users to view all transactions for the specified client. Notably, when the command is used, Model#updateFilteredClientList()
is called to update the client list to just contain that specified client. It also implements the following operations:
Model#setIsViewTransactions(boolean)
— Displays the client list in the GUI when false, and displays the transactions list in the GUI when true.Model#updateTransactionList(ObservableList<Transaction>)
— Updates the transaction list to contain transactions for the specified client.The following sequence diagram shows an example execution of command listt 1
.
As a result of listt INDEX
changing the client list, operations on the transactions (e.g. deletet
and summary
) can now be performed on the transactions list, without specifying the client index.
The following activity diagram shows how the user should use some of our transaction-related commands.
The find transactions command allows for users to find transactions whose descriptions match one of the keywords. The search space is the current transaction list. Therefore, it can only be used in transaction view.
It implements the following operations:
Model#updateTransactionListPredicate(Predicate<Transaction>)
— Updates the transaction list to contain transactions that match any of the keywords.The following sequence diagram shows an example execution of command findt keys
, where keys
represents any number of keywords.
Target user profile:
Value proposition: Manage client contacts and transaction history/info faster than a typical mouse/GUI driven app, tailored specifically for financial consultants dealing with numerous clients and their associated transactions.
Priorities: High (must have) - ***
, Medium (nice to have) - **
, Low (unlikely to have) - *
Priority | As a … | I want to … | So that I can… |
---|---|---|---|
*** | financial consultant | add a new client (add) | track and store client details |
*** | financial consultant with fast turnaround on clients | delete a client (delete) | remove contacts I no longer need |
*** | financial consultant with many clients | view a list of all clients (list) | quickly glance all clients' broad information |
*** | financial consultant with many clients | search for a client by name (find) | quickly find their information |
*** | financial consultant | add transactions to a client's record (addt) | keep track of financial activities for each client |
*** | financial consultant with clients having complex transaction histories | view a list of transactions for a specific client (listt) | assess their financial history at a glance |
*** | financial consultant | delete a transaction from a client's record (deletet) | correct errors or remove outdated information |
*** | financial consultant dealing with many transactions | search transactions by description (findt) | quickly locate specific financial activities |
** | financial consultant prone to making typos | use fuzzy search | find clients even when I'm not sure of the exact spelling |
** | financial consultant with clients having complex transaction histories | calculate the balance for a client | quickly assess their overall financial standing |
** | financial consultant with clients from various industries | tag clients based on industry or other characteristics | easily group and categorise my client base |
** | financial consultant with volatile clients | edit an existing client's details | update their information when needed |
** | financial consultant managing clients with interrelated businesses | use nested tags | simulate relationships between clients more accurately |
* | financial consultant with a growing client base | import and export client data | easily transfer information between systems or share with colleagues |
(For all use cases below, the System is Clientell
and the Actor is the financial consultant
, unless specified otherwise)
Use case: Add a new client
MSS
Extensions
Use case: Delete a client
Preconditions: Financial consultant is in client list view
MSS
Extensions
Use case: List all clients
MSS
Use case: Search for a client by name
Preconditions: Financial consultant is in client list view
MSS
Extensions
Use case: Add a transaction to a client's record
Preconditions: Financial consultant is in client list view
MSS
Extensions
Use case: View list of transactions for a specific client
Preconditions: Financial consultant is in client list view
MSS
Extensions
Use case: Delete a transaction from a client's record
Preconditions: Financial consultant is in transaction list view
MSS
Extensions
Use case: Search transactions by description
Preconditions: Financial consultant is in transaction list view
MSS
Extensions
Use case: Summarise transactions in given range
Preconditions: Financial consultant is in transaction list view
MSS
Extensions
17
or above installed.Given below are instructions to test the app manually.
Note: These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing.
Initial launch
Download the jar file and copy into an empty folder
Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimal.
Saving window preferences
Resize the window to an optimal size. Move the window to a different location. Close the window.
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
Shutting down
exit
clientell.json
is generated in the data file directory if there previously wasn't; otherwise, it updates with any new changes.X
button on the windowDeleting a client in the client list view
Prerequisites: List all clients using the list
command. Multiple clients in the list.
Test case: delete 1
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message.
Test case: delete 0
Expected: No client is deleted. Error details informing of invalid command shown in the status message.
Test case: delete x
, where x
is exactly 1 more than client list size
Expected: No client is deleted. Error detail informing out of range index shown in the status message.
Test case: delete
Expected: No client is deleted. Error details informing of missing index parameter shown in the status message.
Deleting a client in the transaction list view
Prerequisites: List all transactions of a client, such as the first, using the listt 1
command.
Test case: delete 0
Expected: No client is deleted. Error detail informing of invalid command shown in the status message.
Test case: delete 1
Expected: No client is deleted. Error detail informing of environment discrepancy shown in the status message.
Finding a client in the client list view
Prerequisites: List all clients using the list
command. Multiple clients in the list.
Test case: find Alex
Expected: All clients whose name or company contain Alex are shown. Details of the search shown in the status message.
Test case: find
Expected: Error details informing of invalid command format shown in the status message.
Test case: find Alex innovative
Expected: All clients whose name or company contain Alex or innovative are shown. Details of the search shown in the status message.
Finding a client in the transaction list view
Prerequisites: List transactions for a client using the listt INDEX
command.
Test case: find Alex
Expected: Error details informing of environment discrepancy shown in the status message.
Adding a transaction in the client list view.
Prerequisites: List all clients using the list
command. Multiple clients in the list.
Test case: addt 1 d/buy new equipment amt/-1000 o/ABC Motor Group dt/2024-11-17
Expected: Transaction is added to first client. Details of transaction and the client transaction was added to shown in status message.
Test case: addt 0 d/buy new equipment amt/-1000 o/ABC Motor Group dt/2024-11-17
Expected: No transaction is added to any client. UI still shows the full client list. Error details informing of invalid command format shown in the status message.
Test case: addt x d/buy new equipment amt/-1000 o/ABC Motor Group dt/2024-11-17
(where x is larger than list size)
Expected: Expected: No transaction is added to any client. UI still shows the full client list. Error details informing of invalid index shown in the status message.
Adding a transaction in transaction list view.
Prerequisites: List transactions for a client using the listt INDEX
command.
Test case: addt 1 d/buy new equipment amt/-1000 o/ABC Motor Group dt/2024-11-17
Expected: UI still shows the transactions list. Error details informing of environment discrepancy shown in the status message.
Listing transactions in the client list view.
Prerequisites: List all clients using the list
command. Multiple clients in the list.
Test case: listt 1
Expected: Transactions for the first client are shown. Details of the selected client shown in the status message.
Test case: listt 0
Expected: UI still shows the full client list. Error details shown in the status message. Status bar remains the same.
Other incorrect listt commands to try: listt
, listt x
(where x is larger than the list size), listt hello
Expected: Similar to previous.
Listing transactions in the transaction list view.
Prerequisites: List transactions for a client using the listt INDEX
command.
Test case: listt x
Expected: UI still shows the transactions list. Error details shown in the status message. Status bar remains the same.
Finding transactions in the client list view.
Prerequisites: List all clients using the list
command. Multiple clients in the list.
Test case: findt invest
Expected: Error details informing of environment discrepancy shown in the status message.
Finding transactions in the transaction list view.
Prerequisites: List transactions for a client using the listt INDEX
command.
Test case: findt invest
Expected: All transactions whose description contain "invest" are shown. Details of the search shown in the status message.
Test case: findt
Expected: Error details informing of invalid command format shown in the status message.
Test case: findt invest stocks
Expected: All transactions whose description contain "invest" or "stocks" are shown. Details of the search shown in the status message.
Summarising transactions in the client list view.
Prerequisites: List all clients using the list
command. Multiple clients in the list.
Test case: summary s/2024-11 e/2024-12
Expected: Error details informing of environment discrepancy shown in the status message.
Summarising transactions in the transaction list view.
Prerequisites: List transactions for a client using the listt INDEX
command.
Test case: summary s/2024-12 e/2024-12
Expected: The transactions from 2024-12-01
to 2024-12-31
are shown. The total amount of these transactions is shown in the status message.
Test case: summary s/2024-11 e/2025-01
Expected: The transactions from 2024-11-01
to 2025-01-31
are shown. The total amount of these transactions is shown in the status message.
Test case: summary s/2024-11 e/2024-10
Expected: Error details informing of invalid date range shown in the status message.
Test case: summary s/2024-11 e/2024-13
Expected: Error details informing of invalid month or incorrect format shown in the status message.
Test case: summary s/11-2024 e/12-2024
Expected: Error details informing of invalid month or incorrect format shown in the status message.
Missing data file
clientell.json
from the data file directory. If there is no such file, do nothing.Corrupted data file
Test case: Add irrelevant key-value pairs in clientell.json
.
Expected: The app populates data, ignoring all irrelevant key-value pairs.
Test case: Add duplicate key-value pairs in clientell.json
.
Expected: The app populates data, ignoring all duplicates except the final pair.
Test case: Modify an existing value to be illegal in clientell.json
, such as phone: (+1234)
.
Expected: The app launches with an empty UI and no data.
Editing while app is active
Prerequisite: The app is active.
Test case: Make a legal edit anywhere in clientell.json
, such as changing the first client's name to name: "John"
. Then close the app.
Expected: The legal edit is overwritten by the new data from the app's most recent session.
Team size: 5
Overload listt
to not take in an index in transaction list view, to view the whole transactions list for the selected client. Currently, listt INDEX
can only be used in the client list view, and will display the transaction list view. This is inconvenient when the user wants to stay in the transaction list and still want to view the full list, perhaps after searching for some transactions (because he/she would have to return to the client list using list
, then listt INDEX
to get back to the transaction list in full. Future implementation allows listt INDEX
to operate as currently, but also accept listt
without INDEX
to work in the transaction list view and show the full transaction list of the current client.
Improve find
to employ fuzzy search via regular expression (regex). Existing implementation strictly searches for full word, case-insensitively. Future implementation uses regex to allow far more flexible searching, such as (?i)^cla.*r.*ce$
to match all strings starting with cla
, containing r
somewhere in the middle, ending with ce
, case-insensitively (so it might match Clarance
, clairice
, Clarice
, etc.)
Improve findt
to employ fuzzy search via regular expression (regex). Existing implementation strictly searches for full word, case-insensitively. Future implementation uses regex to allow far more flexible searching, such as (?i)^cla.*r.*ce$
to match all strings starting with cla
, containing r
somewhere in the middle, ending with ce
, case-insensitively (so it might match Clarance
, clairice
, Clarice
, etc.)
Improve find
to take in additional logic info to specify what fields to search for. Existing implementation searches for name OR company. Future enhancement will allow user to specify the search with greater granularity e.g company OR address, (name AND email AND company) OR tags, etc.
Improve data saving/loading of corrupted files. Currently, corruption in data file causes app to launch with empty book, and any updates in this session, upon the session's termination, will override the existing corrupted data file. Future enhancement will launch the app with a specified error to inform that the data file is corrupted, and disables usage until the corrupted data file is corrected/recovered. This is to ensure the corrupted data file (which may be important and only suffering from a minor typo) is not permanently lost.
Improve implementation of tags
to support more complex tag relationships. Currently, tags are simply in a list. Future enhancement allows more intricate relationship between tags to better model real world relationships via hierachial structure, likely implemented with nested lists and some global info. For example, it can be specified that the tags bakery
hawker
inherent from tag FnB
, so any tag with bakery
would also be auto-tagged with FnB
for other purposes like searching.
Overload add
to add transactions if the relevant fields for adding a transaction is given. Currently, add
and addt
are separate commands. In future implementation, addt
will be subsumed and overloaded in add
for a more intuitive user experience. For example, if add
is supplied with n/NAME
(and other client fields), it adds a client; if supplied with INDEX
(and other transaction fields), it adds a transaction to the specified indexed client.
Overload find
to find clients and transactions depending on the environment the command is used in. Currently, find
and findt
are separate commands. In future implementation, findt
will be subsumed and overloaded in find
for a more intuitive user experience. This will also work in conjunction with enhancement 4, in which find
is enhanced with more customisable, granular logic. For example, if find
is supplied with usual keywords and used in the client list view, it performs a search in the client list; if supplied with other keywords and used in the transaction list view, it performs a serach on the indexed client's transaction list.
Overload delete
to delete clients and transactions depending on the environment the command is used in. Currently, delete
and deletet
are separate commands. In future implementation, deletet
will be subsumed and overloaded in delete
for a more intuitive user experience. For example, delete INDEX
deletes the indexed client while in the client list view, and deletes the indexed transaction while in the transaction list view.