Refer to the guide Setting up and getting started.
Return to Table Of Contents
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.
Return to Table Of Contents
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, PersonListPanel, 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 Person object residing in the Model.Return to Table Of Contents
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 reaches 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 person).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.Return to Table Of Contents
API : Model.java
The Model component,
Person objects (which are contained in a UniquePersonList object).Person objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Person> 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 Person references. This allows AddressBook to only require one Tag object per unique tag, instead of each Person needing their own Tag objects.

Return to Table Of Contents
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)Return to Table Of Contents
Classes used by multiple components are in the seedu.addressbook.commons package.
Return to Table Of Contents
This section describes some noteworthy details on how certain features are implemented.
InsuraHub allow users to add/edit the preferred contact method of the client using their index relative to the current list shown in InsuraHub
There is only 2 preferred contact methods
Given below is an example usage scenario and how the PreferredContact mechanism behaves at each step
Alex Yeoh, who is already stored in the application.preferredContact 1."At least one field must be provided".preferredContact 1 pc/phone.PreferredContactCommandParser and AddressBookParser will check if the command format provided is valid before PreferredContactCommand#execute() is called.UniquePersonList.CommandResult object.Logic.The following activity diagram shows how the Preferred Contact operation works:

The following sequence diagram shows how the Preferred Contact operation works:

Return to Table Of Contents
The AddTag feature allows users to add tags under a certain client by indexing the client.
Given below is an example usage scenario and how the AddTag mechanism behaves at each step
Alex Yeoh who is the first client listed in InsuraHubfriend to the client Alex Yeoh by entering the command addTag 1 t/friendexecute method of the command will then be used to create a CommandResult objectcreatePersonWithAddedTag method which creates a new client with the same details as Alex Yeoh but with the newly added tagmodel calls the setPerson method and updates the targetted client with the newly created client from the previous stepCommandResult is then returned by the execute method and the UI will display the updated list of clients with Alex Yeoh having the newly added tag and a success message is displayed on the UIThe following activity diagram shows how the AddTag operation works:

The following sequence diagram shows how the AddTag operation works:

Return to Table Of Contents
The DeleteTag feature allows users to delete tags under a certain client by indexing the client.
Given below is an example usage scenario and how the DeleteTag mechanism behaves at each step
Alex Yeoh who is the first person in the InsuraHubDeleteTag 1 t/friendsTags provided do not exist. Please provide an existing tag.friend, the user tries to type DeleteTag 1 t/friend insteadCommandResult objectLogicAlex Yeoh, the tag is deleted from the UI of Alex Yeoh clientDeleted tags successfully for person Alex Yeoh; Phone: 87438807; Email: alexyeoh@example.com; Address: Blk 30 Geylang Street 29, #06-40; Tags: The following activity diagram shows how the DeleteTag operation works:

The following sequence diagram shows how the DeleteTag operation works:

Return to Table Of Contents
The proposed tag filtering mechanism is facilitated by FilterCommandParser, FilterCommand, and FilterTagPredicate.
The FilterContainsKeywordsPredicate implements the Predicate<Person>class which implements the test operation:
test(Person) - Checks through the Set<Tag> of the Person passed to the method for the target tag being filtered.The FilterCommandParser created by the AddressBookParser parses any filter command to create
a FilterCommand object which calls its execute method and the updateFilteredPersonsList method of the Model is
called with the FilterContainsKeywordsPredicate object as its parameter.
Given below is an example usage scenario and how the tag filtering mechanism behaves at each step.
The user launches the application. The current filteredPersonList is simply a list of all Person objects
in the AddressBook.
The user executes filter t/Friend command to filter for all Person objects in the address book
with the tag Friend'. The filter command calls the ParseCommand method of the AddressBookParser which
returns a FilterCommandParser object.
The FilterCommandParser object then calls its parse method, returning a FilterCommand object
which is executed by the LogicManager, calling the updateFilteredPersonList method of the Model.
The update list of filtered Person objects are then displayed on the ui.
The following activity diagram shows how the Filter tag operation works:

The following sequence diagram shows how the Filter tag operation works:

Return to Table Of Contents
InsuraHub allow users to open a folder unique to each client to store their files using their index relative to the current list shown in InsuraHub
these folders are stored in a main folder called ClientFiles in the main directory of InsuraHub
Given below is an example usage scenario and how the file mechanism behaves at each step
Alex Yeoh, who is already stored in the application shown as the first person on InsuraHub.file 1Name of the client will be used as the folder name for the client.Activity diagram for File Command:

Return to Table Of Contents
InsuraHub allow users to filter based on the client preferred meeting region
There are only 5 preferred meeting regions:
Given below is an example usage scenario and how the Group Meeting mechanism behaves at each step
groupmeeting."At least one region must be included".groupmeeting west.GroupMeetingCommandParser and AddressBookParser will check if the command format provided is valid before GroupMeetingCommand#execute() is called.GroupMeetingContainsKeywordPredicateCommandResult object.Logic.Person objects are displayed on the UiActivity diagram for filtering clients based on preferred meeting region:

Sequence diagram for filtering clients based on preferred meeting region:

Return to Table Of Contents
InsuraHub allows users to add insurance policies to keep track of new policies that clients have purchased through them
There are 5 attributes for each policy:
Given below is an example usage scenario and how the Add Policy Mechanism works:
Alex Yeoh who is the first client listed in InsuraHubpolicyName: Health Insurance, policyDescription: Cancer Plan, policyValue: 2000.00, policyStartDate: 2023-01-01, policyEndDate: 2024-12-12addPolicy 1 pn/Health Insurance pd/Cancer Plan pv/2000.00 psd/2023-01-01 ped/2024-12-12execute method of the AddPolicyCommand will be calledcreatePersonWithAddedPolicy method, creating a new Person object with the same details as Alex Yeoh but with the newly added policymodel calls the setPerson method and updates the targetted client with the newly created client from the previous stepCommanResult is then returned by the execute method and the UI will display the updated list of clients with Alex Yeoh having the newly added policy and a success message is displayed on the UIThe following activity diagram shows how the AddPolicy operation works:

The following sequence diagram shows how the AddPolicy operation works:

Return to Table Of Contents
The Remove Policy feature allows users to remove policies under a certain client by indexing the client and indexing the policy to be deleted
Given below is an example usage scenario and how the Remove Policy mechanism behaves at each step
Alex Yeoh who is the first client listed in the InsuraHub UIAlex Yeoh with command removePolicy 1 1execute method of the RemovePolicyCommand object will be calledremovePolicy method on the existing Person object identified by the indexessetPerson method and updates the targetted client with the policy removed from the previous stepCommandResult is then returned by the execute method and the UI will display the updated list of clients with Alex Yeoh not having the policy that was removed and a success message is displayed on the UIThe following activity diagram shows how the RemovePolicy operation works:

The following sequence diagram shows how the RemovePolicy operation works:

Return to Table Of Contents
The View Policy feature allows users to view the details of policies under a certain client by indexing the client and the policy
Given below is an example usage scenario and how the View Policy mechanism behaves at each step
Alex Yeoh who is the first client listed in the InsuraHub UIAlex Yeoh by entering the command viewPolicy 1 1execute method of the ViewPolicyCommand will then be used to create a CommandResult objectpolicyList from a Set to a List and uses a stream to index the target policy to be removedCommandResult is then returned by the execute method with the toString() of the policy indexed from the previous stepThe following activity diagram for viewing policy of a particular Client:

The following sequence diagram shows how the View Policy operation works:

Return to Table Of Contents
InsuraHub allow users to filter clients based on their policy details, currently only filtering policy description
Given below is an example usage scenario and how the Filter Policy mechanism behaves at each step
filterpolicydescription."Invalid Command format" with examples of how to use the command.filterpolicydescription Cancer Plan.FilterPolicyDescriptionCommandParser and AddressBookParser will check if the command format provided is valid before FilterPolicyDescriptionCommand#execute() is called.FilterPolicyDescriptionPredicateCommandResult object.Logic.Person objects are displayed on the UiThe following activity diagram shows how the Filter Policy Description operation works:

The following sequence diagram shows how the Filter Policy Description operation works:

Return to Table Of Contents
InsuraHub allows users to toggle between a dark(default) or light mode to their preference to maximise their productivity
Given below is an example usage scenario and how the Toggle Mode mechanism behaves at each step
toggleModeexecute method of the ToggleModeCommand is calleduiModeManager calls its getUiMode method and stores the current uiMode in a stringuiMode is detected to be the default value of MainWindow.fxml and is updated to LightWindow.fxmlCommandResult is returned by the execute method and the mode of the UI will be switched to Light Mode on the user's next start up of the applicationThe following activity diagram shows how the Toggle Mode operation works:

The following sequence diagram shows how the Toggle Mode operation works:

Return to Table Of Contents
InsuraHub allows users to change the required password to enter InsuraHub
Given below is an example usage scenario and how the changePassword command behaves
changePassword op/oldPW1 np/newPW2passwordManager calls its check method on the old password given "oldPW1" to determine if the current password saved in encoded.txt in the data folder is indeed "oldPW1"passwordManager detects that the old password is indeed correct and calls its set method to set the new password as "newPW2" by modifying the string saved in encoded.txt in the data folder.Activity Diagram for changePassword Command:

The following sequence diagram shows how the changePassword operation works:

Return to Table Of Contents
The proposed undo/redo mechanism is facilitated by VersionedAddressBook. It extends AddressBook with an undo/redo history, stored internally as an addressBookStateList and currentStatePointer. Additionally, it implements the following operations:
VersionedAddressBook#commit() — Saves the current address book state in its history.VersionedAddressBook#undo() — Restores the previous address book state from its history.VersionedAddressBook#redo() — Restores a previously undone address book state from its history.These operations are exposed in the Model interface as Model#commitAddressBook(), Model#undoAddressBook() and Model#redoAddressBook() respectively.
Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.
Step 1. The user launches the application for the first time. The VersionedAddressBook will be initialized with the initial address book state, and the currentStatePointer pointing to that single address book state.
Step 2. The user executes delete 5 command to delete the 5th person in the address book. The delete command calls Model#commitAddressBook(), causing the modified state of the address book after the delete 5 command executes to be saved in the addressBookStateList, and the currentStatePointer is shifted to the newly inserted address book state.
Step 3. The user executes add n/David … to add a new person. The add command also calls Model#commitAddressBook(), causing another modified address book state to be saved into the addressBookStateList.
Note: If a command fails its execution, it will not call Model#commitAddressBook(), so the address book state will not be saved into the addressBookStateList.
Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the undo command. The undo command will call Model#undoAddressBook(), which will shift the currentStatePointer once to the left, pointing it to the previous address book state, and restores the address book to that state.
Note: If the currentStatePointer is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The undo command uses Model#canUndoAddressBook() to check if this is the case. If so, it will return an error to the user rather
than attempting to perform the undo.
The following sequence diagram shows how the undo operation works:
Note: The lifeline for UndoCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
The redo command does the opposite — it calls Model#redoAddressBook(), which shifts the currentStatePointer once to the right, pointing to the previously undone state, and restores the address book to that state.
Note: If the currentStatePointer is at index addressBookStateList.size() - 1, pointing to the latest address book state, then there are no undone AddressBook states to restore. The redo command uses Model#canRedoAddressBook() to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
Step 5. The user then decides to execute the command list. Commands that do not modify the address book, such as list, will usually not call Model#commitAddressBook(), Model#undoAddressBook() or Model#redoAddressBook(). Thus, the addressBookStateList remains unchanged.
Step 6. The user executes clear, which calls Model#commitAddressBook(). Since the currentStatePointer is not pointing at the end of the addressBookStateList, all address book states after the currentStatePointer will be purged. Reason: It no longer makes sense to redo the add n/David … command. This is the behavior that most modern desktop applications follow.
The following activity diagram summarizes what happens when a user executes a new command:
Aspect: How undo & redo executes:
Alternative 1 (current choice): Saves the entire address book.
Alternative 2: Individual command knows how to undo/redo by itself.
delete, just save the person being deleted).Return to Table Of Contents
Return to Table Of Contents
This project is based on the AddressBook-Level3 project created by the SE-EDU initiative.
Return to Table Of Contents
Target user profile:
Value proposition: manage client's contacts faster than a typical mouse/GUI driven app while providing ways to efficiently find/store specific client and their documents
Return to Table Of Contents
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
* * * | new user | see usage instructions | refer to instructions when I forget how to use the App |
* * * | user | add a new person | |
* * * | user | delete a person | remove entries that I no longer need |
* * * | user | find a person by name | locate details of persons without having to go through the entire list |
* * | user | hide private contact details | minimize chance of someone else seeing them by accident |
* | user with many persons in the address book | sort persons by name | locate a person easily |
* * * | insurance agent | Add more tags to my clients | easily find them later |
* * * | insurance agent with multiple documents | Store documents along with client contact information | in an orderly manner |
* * * | insurance agent | Highlight the preferred contact details of my clients | quickly contact them for any matters |
* * * | insurance agent using the CLI | Input and update client information through text commands | provide personalized and efficient service without a graphical interface |
* * * | insurance agent | Filter interested clients | focus my time on providing value to their lives |
* * | insurance agent | Organize my clients’ records based on tags | filter for specific groups of clients |
* * | insurance agent | Cluster my clients into areas they want to meet | set up meetings that minimize my travel time |
* * | busy insurance agent | Load client data quickly | use the app even with high traffic and not waste time waiting |
* * | insurance agent | Sort client priorities | attend to their needs first |
* * | insurance agent prioritizing data security | Create secure log-in passwords and authentication | protect client data integrity |
* * | non-technical insurance agent | Access comprehensive help documentation or a built-in help command | understand available commands, their syntax, and purpose in CLI |
* * | forgetful insurance agent | Have important todos in the homepage | not forget to do them, such as client meetings and applying for claims |
* * | life insurance agent | Easily filter clients with policy updates | inform them more timely on the updates |
* * | insurance agent | Track progress of insurance claims through text-based commands | provide timely updates and ensure a smooth claims process via CLI |
* * | insurance agent | Receive alerts for expiring insurance policies | prioritize meeting clients with expiring policies |
* | insurance agent with traditional clients | Export a client’s policy summary to a spreadsheet | print it out for clients |
* | artistic insurance agent | Customize the UI | feel better using a more unique UI |
* | insurance agent | Create new insurance policies for my clients | accommodate changes or updates requested by clients |
* | insurance agent working with others | Send and receive client details with other users | take over/hand over clients from other agents |
* | data-driven insurance agent | Access a variety of reports and analytics | make informed decisions to improve my business |
Return to Table Of Contents
If not explicitly mentioned, the actor will be a Financial Advisor and InsuraHub as the System.
Precondition: User knows the client index relative to the list and the client is added into the list of clients
MSS:
Extensions:
1a. User did not add a tag
1a1. System displays an error message indicating that user have to key in at least one tag
Use case ends
Return to Table Of Contents
Precondition: User knows the client index relative to the list and the client is added into the list of clients, clients must also have the tag/tags listed in one of their tags.
MSS:
Extensions:
1a. User keys in a tag that is not in the tags that the client originally have.
1a1. System returns an error message stating that the tag is not present and that he/she needs to give a tag that is in the client list of tags.
Use case ends.
1b. User did not provide any tag to be removed
1b1. System returns an error message stating that one tag must be provided.
Use case ends
Return to Table Of Contents
Precondition: User knows the client index relative to the list and the client is added into the list of clients
MSS:
Extensions
1a. User adds in multiple forms of contacts
1a1. System displays an error message to tell the user to select only one form of preferred contact and that the
process of selecting preferred form of contact have failed.
Use case ends
1b. User adds in a invalid preferred form of contact.
1b1. System displays an error message indicating that user can only put in a preferred form of contact with a valid form of contact.
Use case ends
1c. User did not add in any preferred form of contact
1c1. System displays an error message indicating that the user have to put in at least one form of contact.
User case ends
Return to Table Of Contents
MSS:
Return to Table Of Contents
Precondition: User knows the client index relative to the list and the client is added into the list of clients
MSS:
file followed by indexExtensions
1a. User keys in invalid index
1a1. System displays an error message indicating that the process of creating a file for the user is stopped.
Use case ends
Return to Table Of Contents
MSS:
Extensions:
1a. User keys in an invalid region
1a1. System returns an error message stating to put in a valid region to be filtered.
Use Case Ends
Return to Table Of Contents
MSS:
Extensions
1a. The given index is invalid.
1a1. InsuraHub shows an error message.
Use case resumes at step 2.
Return to Table Of Contents
MSS:
Extensions
2a. The list is empty.
Use case ends.
Return to Table Of Contents
Return to Table Of Contents
Return to Table Of Contents
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
OR
Open the command terminal, cd into the folder you put the jar in and use java -jar InsuraHub.jar command to run the application.
Expected: Shows the GUI shown below to ask you to set a password for first timers, first timers will then be asked to key in the password to enter the application.
Users who are not first timers will only be asked to enter the password that is previously saved.

After the password is entered A GUI similar to the below should appear in a few seconds.

Saving window preferences
Resize the window to an optimum 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.
list command.add n/John p/61234567 e/john@email.com a/Blk 312 Choa Chu Kang St 32 pmr/westadd n/John p/61234567 e/john@email.com a/Blk 312 Choa Chu Kang St 32 t/Friends t/Colleagues pmr/westDeleting a client while all clients are being shown
Prerequisites: List all clients using the list command.
Test case: delete 1
Expected: First client is deleted from the list. Details of the deleted client shown in the status message. Timestamp in the status bar is updated.
Test case: delete 0
Expected: No client is deleted. Error details shown in the status message. Status bar remains the same.
Other incorrect delete commands to try: delete, delete x, ... (where x is larger than the list size)
Expected: Similar to previous.
list command.addTag 1 t/FriendsDeleting tags from an existing client
list command.deleteTag 1 t/frienddata/encoded.txt.
changePassword op/OLD PASSWORD np/NEW PASSWORD OLD PASSWORD and the password you wish to have as NEW PASSWORD.
Expected: After leaving the application, you will need to use the new password to enter into the application.list command.addPolicy 1 pn/Health Insurance pd/Cancer Plan pv/2000.00 psd/2023-01-01 ped/2024-12-12list command.removePolicy 1 1removePolicy 1 0list command.file 1Client Files folder, if the file is already there, it will be opened.file 0list command.filter t/friendfriend will be filtered and shown in the filtered list, status message will return the number of people with the tag.filterlist command.filterpolicydescription Cancer PlanCancer Plan will be filtered and shown in the filtered list, status message will return the number of people with the policy, do note that it is case sensative.filterpolicydescriptiongroupmeeting north
Expected: Clients with the preferred meeting location west will be filtered and shown in the filtered list, status message will return the number of people listed with that preferred meeting location.groupmeetingviewPolicy 1 1
Expected: The policy details (policy name, policy description, policy value, start date and end date) will be displayed in the status message.viewPolicy
Expected: There will be an error message stating incorrect command format and that both indexes are required.list command.preferredContact 1 pc/phone
Expected: The preferred contact method of the first client in the list will be highlighted in yellow.preferredContact
Expected: There will be an error message stating incorrect command format and an example command will be shown in the status message.toggleMode
Expected: Success message stating the mode has been changed and InsuraHub will be switched to the other mode upon the next launch.The email parameter for adding a new client to InsuraHub currently only allows alphanumeric characters in the local-part for email addresses in the format local-part@domain.com
The local-part will allow special characters which are commonly used in email addresses with the limitation of having no consecutive special characters together
No errors for Invalid prefixes:
pn prefixes (policy name) returns missing prefixes errorpnpolicy description should be of the prefix pd in the addPolicy command but using an unknown pr prefix that precedes the policy description does not throw any errorpsd and ped are missing, it does not return an error on the UI and silently fails as a runtime erroraddPolicy command entered by the user is a valid command with the correct prefixesThe Add Policy command currently allows for special characters such as ;; which is not how policies would be named
Policy name and description will be checked through for special characters and corresponding error messages will be returned in the UI
The success message is currently not formatted properly with the details of the client wrapped in braces preceded by seedu.address.model….
The success message will be formatted properly
The Preferred Contact command only accepts parameters in lower-case but there is no warning when the user enters a parameter in uppercase
There will be error message returned in the UI when the user enters the parameters not in lowercase (either email or phone)
The end date of the policy can be earlier than the start date of the policy.
There will be error message returned when the end date is earlier than the start date of the policy.
Clients files in the client files folder is retained when clients are deleted or edited
They will be edited or users will be reminded to edit or delete the files according when the client names are edited or deleted accordingly.
Return to Table Of Contents