From bc68b27015c0a7bf3e1f78cb6c003055d620bfb0 Mon Sep 17 00:00:00 2001 From: Jie Xiang Date: Wed, 8 Nov 2023 12:20:16 +0800 Subject: [PATCH 1/6] Hide missing optional fields in Messages --- .../java/seedu/address/logic/Messages.java | 29 +++++++++++-------- .../logic/commands/AddClientCommand.java | 2 +- .../logic/commands/AddLeadCommand.java | 2 +- .../logic/parser/AddLeadCommandParser.java | 1 - 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main/java/seedu/address/logic/Messages.java b/src/main/java/seedu/address/logic/Messages.java index 8e9dd3a33cd..18983dcf734 100644 --- a/src/main/java/seedu/address/logic/Messages.java +++ b/src/main/java/seedu/address/logic/Messages.java @@ -48,12 +48,9 @@ public static String format(Person person) { .append("; Email: ") .append(person.getEmail()) .append("; Address: ") - .append(person.getAddress()) - .append("; Meeting Time: ") - .append(person.getMeetingTimeString()) - .append("; Tags: "); - person.getTags().forEach(builder::append); - return builder.toString(); + .append(person.getAddress()); + + return addOptionalFields(person, builder).toString(); } /** @@ -70,12 +67,20 @@ public static String format(Lead lead) { .append("; Address: ") .append(lead.getAddress()) .append("; Key Milestone: ") - .append(lead.getKeyMilestone()) - .append("; Meeting Time: ") - .append(lead.getMeetingTimeString()) - .append("; Tags: "); - lead.getTags().forEach(builder::append); - return builder.toString(); + .append(lead.getKeyMilestone()); + + return addOptionalFields(lead, builder).toString(); } + private static StringBuilder addOptionalFields(Person person, StringBuilder builder) { + if (person.getMeetingTime().isPresent()) { + builder.append("; Meeting Time: ") + .append(person.getMeetingTimeString()); + } + if (!person.getTags().isEmpty()) { + builder.append("; Tags: "); + person.getTags().forEach(builder::append); + } + return builder; + } } diff --git a/src/main/java/seedu/address/logic/commands/AddClientCommand.java b/src/main/java/seedu/address/logic/commands/AddClientCommand.java index a546e2b7b35..535a9ec6a59 100644 --- a/src/main/java/seedu/address/logic/commands/AddClientCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddClientCommand.java @@ -27,7 +27,7 @@ public class AddClientCommand extends Command { + PREFIX_PHONE + "PHONE " + PREFIX_EMAIL + "EMAIL " + PREFIX_ADDRESS + "ADDRESS " - + PREFIX_MEETING_TIME + "MEETING_TIME " + + "[" + PREFIX_MEETING_TIME + "MEETING_TIME] " + "[" + PREFIX_TAG + "TAG]...\n" + "Example: " + COMMAND_WORD + " " + PREFIX_NAME + "John Doe " diff --git a/src/main/java/seedu/address/logic/commands/AddLeadCommand.java b/src/main/java/seedu/address/logic/commands/AddLeadCommand.java index 355d682ca6f..36ed6b96fab 100644 --- a/src/main/java/seedu/address/logic/commands/AddLeadCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddLeadCommand.java @@ -29,7 +29,7 @@ public class AddLeadCommand extends Command { + PREFIX_EMAIL + "EMAIL " + PREFIX_ADDRESS + "ADDRESS " + PREFIX_KEY_MILESTONE + "KEY_MILESTONE " - + PREFIX_MEETING_TIME + "MEETING_TIME " + + "[" + PREFIX_MEETING_TIME + "MEETING_TIME] " + "[" + PREFIX_TAG + "TAG]...\n" + "Example: " + COMMAND_WORD + " " + PREFIX_NAME + "John Doe " diff --git a/src/main/java/seedu/address/logic/parser/AddLeadCommandParser.java b/src/main/java/seedu/address/logic/parser/AddLeadCommandParser.java index 7006892e032..b7c8503fe4e 100644 --- a/src/main/java/seedu/address/logic/parser/AddLeadCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddLeadCommandParser.java @@ -57,7 +57,6 @@ public AddLeadCommand parse(String args) throws ParseException { : Optional.empty(); Set tagList = ParserUtil.parseTags(argMultimap.getAllValues(PREFIX_TAG)); - // TODO: temporary fix, implement add Client and Lead commands Lead lead = new Lead(name, phone, email, address, keyMilestone, meetingTime, tagList); return new AddLeadCommand(lead); From d6c7572b201da7f17abc71a7c257f316569f348c Mon Sep 17 00:00:00 2001 From: Jie Xiang Date: Wed, 8 Nov 2023 12:35:32 +0800 Subject: [PATCH 2/6] Fix inconsistencies in UG --- docs/UserGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 44e573d7bda..fa74fa4c3fe 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -86,7 +86,7 @@ e.g. if the command specifies `exit 2`, it will be interpreted as the `exit` com ``` Invalid command format! -addlead: Adds a lead to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS k/KEY_MILESTONE m/MEETING_TIME [t/TAG]... +addlead: Adds a lead to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS k/KEY_MILESTONE [m/MEETING_TIME] [t/TAG]... Example: addlead n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 k/01/12/2023 m/10/10/2023 14:30 t/classmate ``` @@ -127,7 +127,7 @@ Example: addlead n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2 ``` Invalid command format! -addclient: Adds a client to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS [t/TAG]... +addclient: Adds a client to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS [m/MEETING_TIME] [t/TAG]... Example: addclient n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 m/10/10/2023 14:30 t/classmate ``` From 1fba56980537bbf278bc2379abee17a713e2ee2a Mon Sep 17 00:00:00 2001 From: Jie Xiang Date: Wed, 8 Nov 2023 17:33:43 +0800 Subject: [PATCH 3/6] Update test cases --- .../address/logic/commands/ConvertClientToLeadCommandTest.java | 2 +- .../address/logic/commands/ConvertLeadToClientCommandTest.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/java/seedu/address/logic/commands/ConvertClientToLeadCommandTest.java b/src/test/java/seedu/address/logic/commands/ConvertClientToLeadCommandTest.java index e4188e3169f..54d3ad5efeb 100644 --- a/src/test/java/seedu/address/logic/commands/ConvertClientToLeadCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ConvertClientToLeadCommandTest.java @@ -46,7 +46,7 @@ public void executeClientConvertToLeadSuccess() throws CommandException { final String expectedOutput = "Converted Client to Lead: Amy Bee; Phone: 85355255; Email: amy@gmail.com; " + "Address: 123, Jurong West Ave 6, #08-111; " - + "Key Milestone: " + formattedDate + "; Meeting Time: null; Tags: "; + + "Key Milestone: " + formattedDate; // Step 1: Set up the necessary test data and model stub. ModelStubAcceptingClientAdded modelStub = new ModelStubAcceptingClientAdded(); diff --git a/src/test/java/seedu/address/logic/commands/ConvertLeadToClientCommandTest.java b/src/test/java/seedu/address/logic/commands/ConvertLeadToClientCommandTest.java index 4dbef11fc91..3cbbe126e9b 100644 --- a/src/test/java/seedu/address/logic/commands/ConvertLeadToClientCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ConvertLeadToClientCommandTest.java @@ -37,8 +37,7 @@ public void constructor_nullPerson_throwsNullPointerException() { @Test public void executeLeadConvertToClientAddSuccessfully() throws CommandException { final String expectedOutput = "Converted Lead to Client: Amy Bee; Phone: 85355255; " - + "Email: amy@gmail.com; Address: 123, Jurong West Ave 6, #08-111; " - + "Meeting Time: null; Tags: "; + + "Email: amy@gmail.com; Address: 123, Jurong West Ave 6, #08-111"; // Step 1: Set up the necessary test data and model stub. ModelStubAcceptingLeadAdded modelStub = new ModelStubAcceptingLeadAdded(); Lead validPerson = new PersonBuilder().buildLead(); From ee3a84e6e9db1a22463a778984520908ff279539 Mon Sep 17 00:00:00 2001 From: Jie Xiang Date: Wed, 8 Nov 2023 22:59:37 +0800 Subject: [PATCH 4/6] Update user guide --- docs/UserGuide.md | 84 ++++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 30 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 44e573d7bda..4b7a4c2a892 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -8,34 +8,47 @@ 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 -- Manage clients’ policies -- Delete policies and leads -- Reminders such as upcoming meetings with leads/clients +- Delete leads and clients +- Keep track of 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) -- [Tutorial for new users](#D.A.V.E.-Tutorial-for-new-users) -- [Features](#Features) +- [Glossary](#glossary) +- [Quick Start](#quick-start) +- [Features](#features) + - [Add lead](#add-lead) + - [Add client](#add-client) + - [View all clients](#view-all-clients) + - [View all leads](#view-all-leads) + - [View specific person](#view-specific-person) + - [Delete entry](#delete-entry) + - [Add meeting time](#add-meeting-time) + - [Delete meeting time](#delete-meeting-time) + - [Edit entry](#edit-entry) + - [Sort meeting time](#sort-meeting-time) + - [Convert lead to client](#convert-lead-to-client) + - [Convert client to lead](#convert-client-to-lead) + - [Locating person by name](#locating-person-by-name) + - [Clear address book](#clear-address-book) + - [Exit the program](#exit-the-program) # Glossary -## Definitions - Here are some descriptions of the words we use throughout the User Guide: -| Term | Definition | -| --- | --- | -| Command | An input from the user that tells D.A.V.E. to perform an action (e.g. add a client). | -| GUI | Graphical User Interface (GUI) refers to the visual display of D.A.V.E that users can see. | -| CLI | Command Line Interface (CLI) represents a text-based user interface to interact with the application. | +| Term | Definition | +|---------|-------------------------------------------------------------------------------------------------------| +| Command | An input from the user that tells D.A.V.E. to perform an action (e.g. add a client). | +| GUI | Graphical User Interface (GUI) refers to the visual display of D.A.V.E that users can see. | +| CLI | Command Line Interface (CLI) represents a text-based user interface to interact with the application. | +| Person | A client or a lead. | -# D.A.V.E. Tutorial for new users +# Quick Start 1. Ensure you have Java `11` or above installed in your computer. -2. Download the latest `DAVE.jar` from here. +2. Download the latest release of `DAVE.jar` from [here](https://github.com/AY2324S1-CS2103T-F08-2/tp/releases). 3. Copy the file to the folder you want to use as the *home folder* for D.A.V.E. 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. @@ -47,9 +60,10 @@ Here are some descriptions of the words we use throughout the User Guide: # 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. + + Extraneous parameters for commands that do not take in parameters (such as help, exit and clear) will be ignored. + For example, if the command entered is exit 2, it will be interpreted as the exit command. + ### Add lead @@ -90,7 +104,7 @@ addlead: Adds a lead to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/A Example: addlead n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 k/01/12/2023 m/10/10/2023 14:30 t/classmate ``` -### Add Client +### Add client - What it does: Add potential clients and their basic information, e.g. name, age, year of study, major, etc. - Command format: `addclient n/NAME p/PHONE e/EMAIL a/ADDRESS [m/MEETING_TIME] [t/TAG]...`. - Example usage: `Example: addclient n/John Doe p/98765432 e/johnd@example.com a/311, Clementi Ave 2, #02-25 m/10/10/2023 14:30 t/classmate`. @@ -210,7 +224,7 @@ There are no leads in the address book

After using View Command on a Client

-### Delete +### Delete entry - What it does: Deletes a lead from your list of leads. - Command format: `delete INDEX`. @@ -307,7 +321,7 @@ Example: deletemeeting 1 ``` -### Edit +### Edit entry - What it does: Edit the details of a lead or client. - Command format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [k/KEY_MILESTONE] [t/TAG]...` @@ -357,6 +371,11 @@ Parameters: INDEX (must be a positive integer) [n/NAME] [p/PHONE] [e/EMAIL] [a/A Example: edit 1 p/91234567 e/johndoe@example.com ``` + + You can add more tags to a person using the edit command. For example, if person 1 already has the tag classmate + and you want to add the friend tag, you can enter the command edit 1 t/classmate t/friend. + + ### Sort meeting time - What it does: Sorts the meeting times of all leads and clients chronologically, displaying @@ -445,15 +464,18 @@ from current date to ensure a follow-up by the user. - Precise expected output when the command fails: -``Invalid command format! +``` +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`` +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` + + 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: @@ -467,15 +489,17 @@ Example usage:

After using find john david

-### Clear +### Clear address book - 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!` + + This command will delete all the data from the address book. This command cannot be reversed. Proceed with caution. + + ### Exit the program - What it does: Exits the program. - Command format: `exit`. From e3d5e281835d081c422da74399b5b332455beb4d Mon Sep 17 00:00:00 2001 From: Jie Xiang Date: Wed, 8 Nov 2023 23:09:16 +0800 Subject: [PATCH 5/6] Add missing line break --- docs/UserGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 3b77fa5521b..35fe348c8e0 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -542,7 +542,7 @@ Example usage: 1. Type `java -jar DAVE.jar` and press enter 1. Dave should launch -**Q**: How can I check my Java version? +**Q**: How can I check my Java version?
**A**: Open a command prompt and type `java -version` . If you do not have Java installed, you can download it [here](https://www.oracle.com/java/technologies/downloads/#java11). From fd38ee508408a1942a427c917c23f4c2287b23a0 Mon Sep 17 00:00:00 2001 From: Jie Xiang Date: Wed, 8 Nov 2023 23:11:38 +0800 Subject: [PATCH 6/6] Fix typos --- docs/UserGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 35fe348c8e0..a1d5a565b37 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -569,8 +569,8 @@ can download it [here](https://www.oracle.com/java/technologies/downloads/#java1 | **Delete meeting time** | `deletemeeting INDEX`
e.g. `deletemeeting 1` | | **Edit** | `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [k/KEY_MILESTONE] [t/TAG]...​`
e.g. `edit 1 n/John Doe p/98765432` | | **Sort meeting time** | `sortmeeting` | -| **Convert lead to client** | `convertoclient INDEX`
e.g. `converttoclient 1` | -| **Convert client to lead** | `convertolead INDEX`
e.g. `converttolead 1` | +| **Convert lead to client** | `converttoclient INDEX`
e.g. `converttoclient 1` | +| **Convert client to lead** | `converttolead INDEX`
e.g. `converttolead 1` | | **Locating person by name** | `find NAME [MORE_NAMES]`
e.g. `find John David` | | **Clear** | `clear` | | **Help** | `help` |