Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into BugFix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxunn committed Nov 9, 2023
2 parents 4c68354 + 0340494 commit 57b38f0
Show file tree
Hide file tree
Showing 21 changed files with 424 additions and 145 deletions.
383 changes: 309 additions & 74 deletions docs/UserGuide.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_markbind/layouts/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* [Quick Start]({{ baseUrl }}/UserGuide.html#quick-start)
* [Features]({{ baseUrl }}/UserGuide.html#features)
* [FAQ]({{ baseUrl }}/UserGuide.html#faq)
* [Command Summary]({{ baseUrl }}/UserGuide.html#faq)
* [Command Summary]({{ baseUrl }}/UserGuide.html#command-summary)
* [Developer Guide]({{ baseUrl }}/DeveloperGuide.html) :expanded:
* [Acknowledgements]({{ baseUrl }}/DeveloperGuide.html#acknowledgements)
* [Setting Up]({{ baseUrl }}/DeveloperGuide.html#setting-up-getting-started)
Expand Down
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.
Binary file added docs/images/helpcommand.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/listcommand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 34 additions & 10 deletions docs/team/liconghuang.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
---
layout: default.md
title: "Licong`s Project Portfolio Page"
---

<h1> Huang Licong's Project Portfolio Page</h1>
### Project: D.A.V.E.

<h3>Project: D.A.V.E.</h3>

D.A.V.E. -
D.A.V.E. is a desktop information storing application used for assisting student financial advisor. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 8 kLoC.

Given below are my contributions to the project.

- New Feature: to be added soon
- Code contributed: to be added soon
- Project Management: to be added soon
- Enhancement to existing features: to be added soon
- Documentation: to be added soon
- Community: to be added soon
- Tools: to be added soon
- **New Feature**: Added the ability to view list of leads / clients command.
- **What it does:** Allows the user to view a filtered list of leads and clients.
- **Justification:** This feature improves the product significantly because a user would be able to view leads and clients seperately easily.

<p></P>

- **New Feature**: Added a command to convert leads to clients and vice versa.
- **What it does**: Allows user to convert leads to client.
- **Justification**: This feature improves the product signficantly because a suer would be able.

<p></p>

- **Code contributed**: [RepoSense link](https://nus-cs2103-ay2324s1.github.io/tp-dashboard/?search=f08&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code&since=2023-09-22&tabOpen=true&tabType=authorship&zFR=false&tabAuthor=LicongHuang&tabRepo=AY2324S1-CS2103T-F08-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false)
<p></p>

- **Project management**:
- Set up codecov for the workflow of the project.
<p></p>


- **Documentation**:
- User Guide:
- Added documentation for the features `converttoclient` and `converttolead`: [\#125](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/125)
- Added documentation for the features `listclient` and `listlead`: [\#81](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/81)
- Developer Guide:
- Added implementation details of the `listclient`, `listlead`, `converttoclient`, `converttolead` feature.


23 changes: 14 additions & 9 deletions docs/team/tiif.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@

Given below are my contributions to the project.

- **New Feature**:
- to be added soon.
- **Code contributed**:
- to be added soon.
- **New Feature**: Added the ability to add ``keyMilestone`` for a lead.
- **What it does:** Empowering financial advisors to capture pivotal moments in a lead's journey, strategically enhancing conversion rates from leads to clients.
- **Significance:** This feature not only distinguishes leads from clients but also streamlines the process with recent code refinements, making future additions of fields for leads or clients more efficient.
- **Code contributed**: [RepoSense link](https://nus-cs2103-ay2324s1.github.io/tp-dashboard/?search=f08&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code&since=2023-09-22&tabOpen=true&tabType=authorship&zFR=false&tabAuthor=tiif&tabRepo=AY2324S1-CS2103T-F08-2%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false)
- **Project Management**:
- to be added soon.
- Managed release ``v1.3.trial`` on GitHub
- Reverted pull request (Pull request [#80](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/80))
- **Enhancement to existing features**:
- to be added soon.
- Wrote additional test for existing features (Pull request [#75](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/75))
- **Documentation**:
- to be added soon.
- User Guide:
- Added Command Summary and FAQ section
- Added more details for ``edit``, ``addlead`` and ``addclient``
- Developer Guide:
- Updated ``manual testing`` section.
- **Community**:
- to be added soon.
- PRs reviewed: [#66](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/66), [#77](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/77), [#79](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/79), [#93](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/93), [#97](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/97), [#102](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/102), [#104](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/104), [#122](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/122), [#181](https://github.com/AY2324S1-CS2103T-F08-2/tp/pull/181)
- **Tools**:
- to be added soon.
- Setup project website using Markbind
29 changes: 17 additions & 12 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand All @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
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 names (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters: NAME [MORE_NAMES]...\n"
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\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
Expand Up @@ -57,7 +57,6 @@ public AddLeadCommand parse(String args) throws ParseException {
: Optional.empty();
Set<Tag> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void executeClientConvertToLeadSuccess() throws CommandException {

final String expectedOutput = "Converted Client to Lead: Amy Bee; Phone: 85355255; Email: [email protected]; "
+ "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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]; Address: 123, Jurong West Ave 6, #08-111; "
+ "Meeting Time: null; Tags: ";
+ "Email: [email protected]; 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();
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);
}
}
27 changes: 15 additions & 12 deletions src/test/java/seedu/address/logic/commands/ListLeadCommandTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {

Expand All @@ -23,15 +26,13 @@ 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());
expectedPersonModel = new ModelManager(personModel.getAddressBook(), new UserPrefs());
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());
}


Expand All @@ -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<Person> predicate = ListLeadCommand.LEAD_TAG_PREDICATE;
Predicate<Person> 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<Person> 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);
}
}

0 comments on commit 57b38f0

Please sign in to comment.