Skip to content

Commit

Permalink
Merge branch 'master' into branch-fix-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tiif committed Nov 8, 2023
2 parents 4f986e0 + 86a6e91 commit e55cfde
Show file tree
Hide file tree
Showing 13 changed files with 154 additions and 41 deletions.
117 changes: 109 additions & 8 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@

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
- Manage clients’ policies
- 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)
Expand All @@ -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.

<div align="center">
<img src="./images/QuickStartGUI.png" width="500" />
<p>After starting up the application</p>
</div>

# 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.
Expand Down Expand Up @@ -142,7 +154,6 @@ Example: addclient n/John Doe p/98765432 e/[email protected] a/311, Clementi Ave
In output section of the
`List of all clients`

<h4>Examples of usage:</h4>

<div align="center">
<img src="./images/List.png" width="500" />
Expand All @@ -151,6 +162,15 @@ In output section of the
<p>After using listclient command</p>
</div>

- 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.
Expand All @@ -159,7 +179,6 @@ In output section of the

`List of all leads`

<h4>Example usage:</h4>

<div align="center">
<img src="./images/List.png" width = "500"/>
Expand All @@ -168,6 +187,15 @@ In output section of the
<p>After using listlead command</p>
</div>

- 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
Expand Down Expand Up @@ -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

<div align="center">
<img src="./images/beforeconverttoclient.png" width = "500"/>
<p>Before using converttoclient</p>
</div>

<div align="center">
<img src="./images/converttoclient.png" width = "500"/>
<p>After using converttoclient</p>
</div>

- Precise expected outputs when the command succeeds:

`Converted lead to client`
Expand All @@ -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

<div align="center">
<img src="./images/beforeconverttolead.png" width = "500"/>
<p>Before using converttolead</p>
</div>

<div align="center">
<img src="./images/converttolead.png" width = "500"/>
<p>After using converttolead</p>
</div>

- 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:

`<NUMBER> 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:

<div align="center">
<img src="./images/BeforeFind.png" width = "500"/>
<p>Before using find</p>
</div>

<div align="center">
<img src="./images/AfterFind.png" width = "500"/>
<p>After using find john david</p>
</div>

### 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?<br>
Expand Down Expand Up @@ -448,6 +548,7 @@ Action | Format, Examples
**Sort meeting time** | `sortmeeting`
**Convert lead to client** | `convertoclient INDEX` <br> e.g. `converttoclient 1`
**Convert client to lead** | `convertolead INDEX` <br> e.g. `converttolead 1`
**Locating person by name** | `find NAME [MORE_NAMES]` <br> e.g. `find John David`
**Clear** | `clear`
**Help** | `help`
**Exit** | `exit`
Binary file added docs/images/AfterFind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/BeforeFind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/QuickStartGUI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/beforeconverttoclient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/beforeconverttolead.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/converttoclient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/converttolead.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/FindCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ 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<Person> CLIENT_TAG_PREDICATE = person -> person.isClient();

private static final Logger logger = LogsCenter.getLogger(ListClientCommand.class);

@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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ 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<Person> LEAD_TAG_PREDICATE = person -> person.isLead();

private static final Logger logger = LogsCenter.getLogger(ListLeadCommand.class);

@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);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

Expand All @@ -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
Expand All @@ -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<Person> 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<Person> 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);
}
}
Loading

0 comments on commit e55cfde

Please sign in to comment.