diff --git a/docs/UserGuide.md b/docs/UserGuide.md index df23abc7eac..d95cdafa0be 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -8,37 +8,50 @@ 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](#delete) + - [Add meeting time](#add-meeting-time) + - [Delete meeting time](#delete-meeting-time) + - [Edit](#edit) + - [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) - [FAQ](#faq) - [Known issues](#known-issues) - [Command Summary](#command-summary) # 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. @@ -50,9 +63,9 @@ Here are some descriptions of the words we use throughout the User Guide: # Features - -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 @@ -95,11 +108,11 @@ e.g. if the command specifies exit 2, it will be interpreted as the ``` 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 ``` -### 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`. @@ -142,7 +155,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 ``` @@ -322,7 +335,7 @@ Example: deletemeeting 1 ``` -### Edit +### Edit - What it does: Edit the details of a lead or a client. - Command format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [k/KEY_MILESTONE] [t/TAG]...` @@ -332,7 +345,6 @@ Example: deletemeeting 1 - Example usage: `edit 1 n/John Doe p/98765432` - This command will clear the tags of a lead or client. @@ -382,6 +394,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 @@ -497,7 +514,7 @@ Example usage:

After using find john david

-### Clear +### Clear address book - What it does: Clears all entries from the address book. @@ -509,6 +526,10 @@ Example usage: `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`. @@ -527,7 +548,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). @@ -541,22 +562,22 @@ can download it [here](https://www.oracle.com/java/technologies/downloads/#java1 ## Command summary -Action | Format, Examples ------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------- -**Add lead** | `addlead n/NAME p/PHONE e/EMAIL a/ADDRESS k/KEY_MILESTONE [m/MEETING_TIME] [t/TAG]...​`
e.g. `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** | `addclient n/NAME p/PHONE e/EMAIL a/ADDRESS [m/MEETING_TIME] [t/TAG]...​`
e.g. `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` -**View all leads and clients** | `list` -**View all clients** | `listclient` -**View all leads** | `listlead` -**View a specific person** | `view INDEX`
e.g. `view 1` -**Delete** | `delete INDEX`
e.g. `delete 1` -**Add meeting time** | `addmeeting INDEX m/MEETING_TIME`
e.g. `addmeeting 1 m/12/10/2023 16:00` -**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` -**Locating person by name** | `find NAME [MORE_NAMES]`
e.g. `find John David` -**Clear** | `clear` -**Help** | `help` -**Exit** | `exit` +| Action | Format, Examples | +|--------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Add lead** | `addlead n/NAME p/PHONE e/EMAIL a/ADDRESS k/KEY_MILESTONE [m/MEETING_TIME] [t/TAG]...​`
e.g. `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** | `addclient n/NAME p/PHONE e/EMAIL a/ADDRESS [m/MEETING_TIME] [t/TAG]...​`
e.g. `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` | +| **View all leads and clients** | `list` | +| **View all clients** | `listclient` | +| **View all leads** | `listlead` | +| **View a specific person** | `view INDEX`
e.g. `view 1` | +| **Delete** | `delete INDEX`
e.g. `delete 1` | +| **Add meeting time** | `addmeeting INDEX m/MEETING_TIME`
e.g. `addmeeting 1 m/12/10/2023 16:00` | +| **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** | `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` | +| **Exit** | `exit` | 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); 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();