diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 591efbe6275..4b70faecf57 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -4,7 +4,7 @@ D.A.V.E. is a leads and clients management tool for student financial advisors specifically in NUS, but can be used for all student financial advisors. -Here’s a quick overview of D.A.V.E.’s features +Here’s a quick overview of D.A.V.E.’s features: - Store and edit information of your leads and clients - Convert successful leads into clients @@ -12,6 +12,8 @@ Here’s a quick overview of D.A.V.E.’s features - Delete policies and leads - Reminders such as upcoming meetings with leads/clients +D.A.V.E. is here to enhance your advisory journey by simplifying information management, lead conversion, policy tracking and more. + # Table of Contents - [Glossary](#Glossary) @@ -38,10 +40,20 @@ Here are some descriptions of the words we use throughout the User Guide: 1. Ensure you have Java `11` or above installed in your computer. 2. Download the latest `DAVE.jar` from here. 3. Copy the file to the folder you want to use as the *home folder* for D.A.V.E. -4. Double-click `DAVE.jar` to start the app. +4. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar DAVE.jar` command to run the application. + A GUI similar to the below should appear in a few seconds. Note how the app contains some sample data. + +
+ +

After starting up the application

+
# Features +> [!NOTE] +> Extraneous parameters for commands that do not take in parameters (such as help, exit and clear) will be ignored. +e.g. if the command specifies `exit 2`, it will be interpreted as the `exit` command. + ### Add lead - What it does: Add potential leads and their basic information, e.g. name, age, year of study, major, etc. @@ -142,7 +154,6 @@ Example: addclient n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave In output section of the `List of all clients` -

Examples of usage:

@@ -151,6 +162,15 @@ In output section of the

After using listclient command

+- Precise expected outputs when the commands succeeds: +``` +Listed all clients +``` +- Precise expected outputs when there are no clients stored: +``` +There are no clients in the address book +``` + ### View all leads - What it does: View all leads you have stored, including their basic information and index in the list of leads, e.g. id, name, age, gender, occupation, etc. @@ -159,7 +179,6 @@ In output section of the `List of all leads` -

Example usage:

@@ -168,6 +187,15 @@ In output section of the

After using listlead command

+- Precise expected outputs when commands succeeds: +``` +Listed all leads +``` +- Precise expected outputs when there are no leads stored: +``` +There are no leads in the address book +``` + ### View Specific Person - What it does: View a specific person that you have stored, including their basic information and another relevant lead/client @@ -377,10 +405,22 @@ only entries with a meeting time. ### Convert lead to client - What it does: Converts a lead to client. -- Command format: `convertoclient INDEX` +- Command format: `converttoclient INDEX` - Example usage: `converttoclient 1` - Acceptable values for each parameter: - `INDEX`: Any integer from `1` to the last index of the leads list +- Example usage + +
+ +

Before using converttoclient

+
+ +
+ +

After using converttoclient

+
+ - Precise expected outputs when the command succeeds: `Converted lead to client` @@ -389,23 +429,83 @@ only entries with a meeting time. `The person index provided is invalid` + ### Convert client to lead - What it does: Converts a client into lead, the ``KEY_MILESTONE`` is 1 year from current date to ensure a follow-up by the user. -- Command format: `convertolead INDEX` +- Command format: `converttolead INDEX` - Example usage: `converttolead 1` - Acceptable values for each parameter: - `INDEX`: Any integer from `1` to the last index of the leads list. -- Precise expected outputs when the command succeeds: +- Example usage +
+ +

Before using converttolead

+
+ +
+ +

After using converttolead

+
+ +- Precise expected outputs when the command succeeds: `Converted client to lead` - Precise expected outputs when the command fails: `The person index provided is invalid` ---------------------------------------------------------------------------- + +### Locating person by name +- What it does: Finds persons whose names contain any of the given keywords. +- Command format: `find NAME [MORE_NAMES]` +- Example usage: `find John David` +- Acceptable values for parameter: + - `NAME`: Any name from the list. +- Precise expected output when the command succeeds: + +` persons listed!` + +- Precise expected output when the command fails: + +``Invalid command format! +find: Finds all persons whose names contain any of the specified names (case-insensitive) and displays them as a list with index numbers. +Parameters: NAME [MORE_NAMES]... +Example: find alice bob charlie`` + +>[!NOTE] +>- The search is case-insensitive. e.g `John` will match `john`. +>- Only full words will be matched e.g. `John` will not match `Johns`. +>- Persons matching at least one keyword will be returned (i.e. OR search). e.g. `find john david` will return `John Doe`, `David Li` + +Example usage: + +
+ +

Before using find

+
+ +
+ +

After using find john david

+
+ +### Clear +- What it does: Clears all entries from the address book. +- Command format: `clear`. +> [!WARNING] +> This command will delete all the data from the address book. This command cannot be reversed. Proceed with caution. +- Precise expected output when the command succeeds: + +`Address book has been cleared!` + +### Exit the program +- What it does: Exits the program. +- Command format: `exit`. + +-------------------------------------------------------------------------- ## FAQ **Q**: How do I transfer my data to another computer?
@@ -448,6 +548,7 @@ Action | Format, Examples **Sort meeting time** | `sortmeeting` **Convert lead to client** | `convertoclient INDEX`
e.g. `converttoclient 1` **Convert client to lead** | `convertolead INDEX`
e.g. `converttolead 1` +**Locating person by name** | `find NAME [MORE_NAMES]`
e.g. `find John David` **Clear** | `clear` **Help** | `help` **Exit** | `exit` diff --git a/docs/images/AfterFind.png b/docs/images/AfterFind.png new file mode 100644 index 00000000000..4334ffb1d47 Binary files /dev/null and b/docs/images/AfterFind.png differ diff --git a/docs/images/BeforeFind.png b/docs/images/BeforeFind.png new file mode 100644 index 00000000000..c6abbece74e Binary files /dev/null and b/docs/images/BeforeFind.png differ diff --git a/docs/images/QuickStartGUI.png b/docs/images/QuickStartGUI.png new file mode 100644 index 00000000000..a31d8f60f0f Binary files /dev/null and b/docs/images/QuickStartGUI.png differ diff --git a/docs/images/beforeconverttoclient.png b/docs/images/beforeconverttoclient.png new file mode 100644 index 00000000000..672fa6bfa96 Binary files /dev/null and b/docs/images/beforeconverttoclient.png differ diff --git a/docs/images/beforeconverttolead.png b/docs/images/beforeconverttolead.png new file mode 100644 index 00000000000..e120db48b85 Binary files /dev/null and b/docs/images/beforeconverttolead.png differ diff --git a/docs/images/converttoclient.png b/docs/images/converttoclient.png new file mode 100644 index 00000000000..4c1e0f8a503 Binary files /dev/null and b/docs/images/converttoclient.png differ diff --git a/docs/images/converttolead.png b/docs/images/converttolead.png new file mode 100644 index 00000000000..b0b3dda6104 Binary files /dev/null and b/docs/images/converttolead.png differ diff --git a/src/main/java/seedu/address/logic/commands/FindCommand.java b/src/main/java/seedu/address/logic/commands/FindCommand.java index 72b9eddd3a7..f04b419c6ef 100644 --- a/src/main/java/seedu/address/logic/commands/FindCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindCommand.java @@ -16,8 +16,8 @@ public class FindCommand extends Command { public static final String COMMAND_WORD = "find"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all persons whose names contain any of " - + "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n" - + "Parameters: KEYWORD [MORE_KEYWORDS]...\n" + + "the specified names (case-insensitive) and displays them as a list with index numbers.\n" + + "Parameters: NAME [MORE_NAMES]...\n" + "Example: " + COMMAND_WORD + " alice bob charlie"; private final NameContainsKeywordsPredicate predicate; diff --git a/src/main/java/seedu/address/logic/commands/ListClientCommand.java b/src/main/java/seedu/address/logic/commands/ListClientCommand.java index 0e924f0c3fd..5f54aa695f0 100644 --- a/src/main/java/seedu/address/logic/commands/ListClientCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListClientCommand.java @@ -18,6 +18,7 @@ public class ListClientCommand extends Command { public static final String COMMAND_WORD = "listclient"; public static final String MESSAGE_SUCCESS = "Listed all clients"; + public static final String MESSAGE_NO_CLIENTS = "There are no clients in the address book"; public static final Predicate CLIENT_TAG_PREDICATE = person -> person.isClient(); private static final Logger logger = LogsCenter.getLogger(ListClientCommand.class); @@ -25,8 +26,10 @@ public class ListClientCommand extends Command { @Override public CommandResult execute(Model model) { requireNonNull(model); - model.updateFilteredPersonList(CLIENT_TAG_PREDICATE); + if (model.getFilteredPersonList().size() == 0) { + return new CommandResult(MESSAGE_NO_CLIENTS); + } return new CommandResult(MESSAGE_SUCCESS); } } diff --git a/src/main/java/seedu/address/logic/commands/ListLeadCommand.java b/src/main/java/seedu/address/logic/commands/ListLeadCommand.java index 98061897755..5b9283eb866 100644 --- a/src/main/java/seedu/address/logic/commands/ListLeadCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListLeadCommand.java @@ -17,7 +17,7 @@ public class ListLeadCommand extends Command { public static final String COMMAND_WORD = "listlead"; public static final String MESSAGE_SUCCESS = "Listed all leads"; - + public static final String MESSAGE_NO_LEADS = "There are no leads in the address book"; public static final Predicate LEAD_TAG_PREDICATE = person -> person.isLead(); private static final Logger logger = LogsCenter.getLogger(ListLeadCommand.class); @@ -25,8 +25,10 @@ public class ListLeadCommand extends Command { @Override public CommandResult execute(Model model) { requireNonNull(model); - model.updateFilteredPersonList(LEAD_TAG_PREDICATE); + if (model.getFilteredPersonList().size() == 0) { + return new CommandResult(MESSAGE_NO_LEADS); + } return new CommandResult(MESSAGE_SUCCESS); } } diff --git a/src/test/java/seedu/address/logic/commands/ListClientCommandTest.java b/src/test/java/seedu/address/logic/commands/ListClientCommandTest.java index 8f47098aa56..0b74a68f90c 100644 --- a/src/test/java/seedu/address/logic/commands/ListClientCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ListClientCommandTest.java @@ -1,6 +1,8 @@ package seedu.address.logic.commands; +import static org.junit.jupiter.api.Assertions.assertEquals; import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; +import static seedu.address.logic.commands.ListClientCommand.MESSAGE_NO_CLIENTS; import static seedu.address.logic.commands.ListClientCommand.MESSAGE_SUCCESS; import static seedu.address.testutil.TypicalClients.getTypicalClientsAddressBook; import static seedu.address.testutil.TypicalLeads.getTypicalLeadsAddressBook; @@ -14,14 +16,15 @@ import seedu.address.model.Model; import seedu.address.model.ModelManager; import seedu.address.model.UserPrefs; +import seedu.address.model.person.Client; import seedu.address.model.person.Person; +import seedu.address.testutil.PersonBuilder; public class ListClientCommandTest { private Model personModel; private Model expectedPersonModel; private Model leadModel; - private Model expectedLeadModel; private Model clientModel; private Model expectedClientModel; @@ -32,7 +35,6 @@ public void setUp() { clientModel = new ModelManager(getTypicalClientsAddressBook(), new UserPrefs()); expectedClientModel = new ModelManager(clientModel.getAddressBook(), new UserPrefs()); leadModel = new ModelManager(getTypicalLeadsAddressBook(), new UserPrefs()); - expectedLeadModel = new ModelManager(leadModel.getAddressBook(), new UserPrefs()); } //filter list with both client and leads @@ -44,23 +46,25 @@ public void execute_personListIsFiltered_showsEverything() { expectedPersonModel.updateFilteredPersonList(predicate); assertCommandSuccess(new ListClientCommand(), personModel, MESSAGE_SUCCESS, expectedPersonModel); } - //filter list with only clients + + //filter list with only leads + + @Test - public void execute_clientListIsFiltered_showsEverything() { - // Filter the model as required by ListClientCommand - Predicate predicate = ListClientCommand.CLIENT_TAG_PREDICATE; - clientModel.updateFilteredPersonList(predicate); - expectedClientModel.updateFilteredPersonList(predicate); - assertCommandSuccess(new ListClientCommand(), clientModel, MESSAGE_SUCCESS, expectedClientModel); + public void execute_clientListIsEmpty() { + ListClientCommand listClientCommand = new ListClientCommand(); + CommandResult commandResult = listClientCommand.execute(leadModel); + String stringOutput = commandResult.getFeedbackToUser(); + assertEquals(stringOutput, MESSAGE_NO_CLIENTS); } - //filter list with only leads @Test - public void execute_leadListIsFiltered_showsEverything() { - // Filter the model as required by ListLeadCommand - Predicate predicate = ListClientCommand.CLIENT_TAG_PREDICATE; - leadModel.updateFilteredPersonList(predicate); - expectedLeadModel.updateFilteredPersonList(predicate); - assertCommandSuccess(new ListClientCommand(), leadModel, ListClientCommand.MESSAGE_SUCCESS, expectedLeadModel); + public void execute_clientListIsFiltered_showsEverything() { + Client exampleClient = new PersonBuilder().buildClient(); + leadModel.addClient(exampleClient); + ListClientCommand listClientCommand = new ListClientCommand(); + CommandResult commandResult = listClientCommand.execute(leadModel); + String stringOutput = commandResult.getFeedbackToUser(); + assertEquals(stringOutput, ListClientCommand.MESSAGE_SUCCESS); } } diff --git a/src/test/java/seedu/address/logic/commands/ListLeadCommandTest.java b/src/test/java/seedu/address/logic/commands/ListLeadCommandTest.java index 7796e2d7940..e6db8c36d8a 100644 --- a/src/test/java/seedu/address/logic/commands/ListLeadCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ListLeadCommandTest.java @@ -1,5 +1,6 @@ package seedu.address.logic.commands; +import static org.junit.jupiter.api.Assertions.assertEquals; import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; import static seedu.address.logic.commands.ListLeadCommand.MESSAGE_SUCCESS; import static seedu.address.testutil.TypicalClients.getTypicalClientsAddressBook; @@ -14,7 +15,9 @@ import seedu.address.model.Model; import seedu.address.model.ModelManager; import seedu.address.model.UserPrefs; +import seedu.address.model.person.Lead; import seedu.address.model.person.Person; +import seedu.address.testutil.PersonBuilder; public class ListLeadCommandTest { @@ -23,7 +26,6 @@ public class ListLeadCommandTest { private Model leadModel; private Model expectedLeadModel; private Model clientModel; - private Model expectedClientModel; @BeforeEach public void setUp() { personModel = new ModelManager(getTypicalAddressBook(), new UserPrefs()); @@ -31,7 +33,6 @@ public void setUp() { leadModel = new ModelManager(getTypicalLeadsAddressBook(), new UserPrefs()); expectedLeadModel = new ModelManager(leadModel.getAddressBook(), new UserPrefs()); clientModel = new ModelManager(getTypicalClientsAddressBook(), new UserPrefs()); - expectedClientModel = new ModelManager(clientModel.getAddressBook(), new UserPrefs()); } @@ -44,24 +45,26 @@ public void execute_personListIsFiltered_showsEverything() { assertCommandSuccess(new ListLeadCommand(), personModel, MESSAGE_SUCCESS, expectedPersonModel); } - //filter list with only leads + //filter list with only clients @Test - public void execute_leadListIsFiltered_showsEverything() { + public void execute_leadListIsEmpty() { // Filter the model as required by ListLeadCommand - Predicate predicate = ListLeadCommand.LEAD_TAG_PREDICATE; + Predicate predicate = ListClientCommand.CLIENT_TAG_PREDICATE; leadModel.updateFilteredPersonList(predicate); expectedLeadModel.updateFilteredPersonList(predicate); - assertCommandSuccess(new ListLeadCommand(), leadModel, ListLeadCommand.MESSAGE_SUCCESS, expectedLeadModel); + assertCommandSuccess( + new ListClientCommand(), leadModel, ListClientCommand.MESSAGE_NO_CLIENTS, expectedLeadModel); } - //filter list with only clients @Test - public void execute_clientListIsFiltered_showsEverything() { + public void execute_leadListIsFiltered_showsEverything() { // Filter the model as required by ListLeadCommand - Predicate predicate = ListLeadCommand.LEAD_TAG_PREDICATE; - clientModel.updateFilteredPersonList(predicate); - expectedClientModel.updateFilteredPersonList(predicate); - assertCommandSuccess(new ListLeadCommand(), clientModel, MESSAGE_SUCCESS, expectedClientModel); + Lead exampleLead = new PersonBuilder().buildLead(); + leadModel.addLead(exampleLead); + ListLeadCommand listLeadCommand = new ListLeadCommand(); + CommandResult commandResult = listLeadCommand.execute(leadModel); + String stringOutput = commandResult.getFeedbackToUser(); + assertEquals(stringOutput, ListLeadCommand.MESSAGE_SUCCESS); } }