Skip to content

Commit

Permalink
Merge branch 'AY2324S1-CS2103T-T09-2:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahidharah authored Oct 26, 2023
2 parents 9e47842 + fbadbc5 commit 5eb1ad3
Show file tree
Hide file tree
Showing 51 changed files with 692 additions and 202 deletions.
41 changes: 18 additions & 23 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,36 +262,31 @@ _{Explain here how the data archiving feature will be implemented}_
* can type fast
* prefers typing to mouse interactions
* is reasonably comfortable using CLI apps
* an employee or employer within a software company
* a project manager or someone with similar needs working within a software company

**Value proposition**: combines contact management with role-specific features, making it easy for employees
to manage company contacts faster than a typical mouse/GUI driven app
**Value proposition**: CodeContact aims to seamlessly integrate contact, client, and project management, simplifying access to coding-related contacts, facilitating collaboration, and offering command-line efficiency for project managers.


### User stories

Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*`

| Priority | As a …​ | I want to …​ | So that I can…​ |
|----------|-----------------|---------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `* * *` | new user | see usage instructions | refer to instructions when I forget how to use the App |
| `* * *` | company boss | set up a new company profile | allow employees of my organisation to use the App |
| `* * *` | company boss | view all employee's contacts and details | quickly communicate with my employees |
| `* * *` | HR staff | add new employee details quickly | keep the employee directory up-to-date |
| `* * *` | HR staff | add new employees details directly from a file | import employee details easily |
| `* * *` | HR staff | delete employee details | keep the employee directory updated when an employee leaves |
| `* * *` | HR staff | view restricted salary information of employees | review and make changes to it if necessary |
| `* * *` | HR staff | view all the information of all the employees in the company | quickly communicate with them regarding HR matters |
| `* * *` | HR staff | edit any information of all the employees in the company | keep the employee directory updated |
| `* * *` | any employee | login as a specific user | access user-specific features |
| `* * *` | any employee | view the contact details of other employees | get in touch with them if necessary |
| `* * *` | any employee | search up other employees' contacts based on their details | to locate their information easily |
| `* * *` | developer | view the project-specific roles and Github accounts of my teammates | contact the relevant team member for project-related issues |
| `* * *` | project manager | edit the project-specific roles of project collaborators under me | allow project collaborators to get in touch with the relevant people regarding project matters |
| `* *` | company boss | set up a company information page | allow employees to view the company's mission, vision, and values |
| `* *` | company boss | view project manage reports on resource allocation | ensure projects are running efficiently |
| `* *` | employee | view my company's information page | be aligned with the organisation's mission, vision, and values |
| `* *` | project manager | view a list of project collaborators and their contact information | access contact details easily and quickly assemble teams for new projects |
| Priority | As a …​ | I want to …​ | So that I can…​ |
|----------|-----------------|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| `* * *` | project manager | add a list of Developers and their contact information | access contact details easily and quickly assemble teams for new projects |
| `* * *` | project manager | add a list of Clients and their contact information | access client details easily and know who is related to what project. |
| `* * *` | project manager | add a list of Projects and their details | access project details easily and see who is related to the project |
| `* * *` | project manager | delete information about a Client or Developer and the project details will update accordingly | don't repeat deleting several time |
| `* * *` | project manager | edit the the details of the Developers added in | constantly update the contact book |
| `* * *` | project manager | edit the the details of the Clients added in | constantly update the contact book |
| `* * *` | project manager | edit the the details of the Projects added in | constantly update any changes to the project |
| `* * *` | project manager | find the the Developers according to any details they have | source for information related to developers easily |
| `* * *` | project manager | find the the Clients according to any details they have | source for information related to clients easily |
| `* * *` | project manager | find the the Projects according to any details they have | source for information related to projects easily |
| `* * *` | project manager | list different groups of people according to the different commands | view projects, clients and developers can be as different lists |
| `* * *` | project manager | switch between tabs for Developers, Clients and Projects | intuitively view the different data lists |
| `* *` | project manager | | |
| `* *` | project manager | | |


*{More to be added}*
Expand Down
24 changes: 12 additions & 12 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CodeContact is a **desktop app for managing contacts, optimized for use via a Co
* [Adding new information `add`](#adding-new-information--add)
* [Editing information `edit`](#edit)
* [Finding information `search`](#search-according-to-type-and-industry-details--search)
* [Listing information `list`](#listing-all-developers--list)
* [Listing information `list`](#listing-information--list)
* [Delete information `delete`](#deleting-a-developer--delete)
* [Help `help`](#viewing-help--help)
* [Clear entries `clear`](#clearing-all-entries--clear)
Expand Down Expand Up @@ -274,29 +274,29 @@ When command fails due to an error, the respective error message will be display

Relevant UI mock-ups (???)

### Search according to type and industry details: `search`
### Find according to type and industry details: `Find`
* What it does
* Every user can search for contacts related to the keyword (eg. by search prj name, members of the prj team will appear)
* Project managers can find developers and clients for contacts related to the keyword (eg. by Find project name, members of the project team will appear)
* Format
* `Search p/<Project Name>`
* `Search r/<Role>`
* `Search n/<Name>`
* `find -d p/<Project Name>`
* `find -d r/<Role>`
* `find client n/<Name>`
* Example
* `Search p/2103/T` (Prints everyone in 2103/T prj)
* `Search r/Senior Developer` (Prints everyone of the senior developer role)
* `Search n/Amy` (Prints everyone of the name Amy)
* `find -d p/2103/T` (Prints developers in 2103/T prj)
* `find -d r/Senior Developer` (Prints developers of the senior developer role)
* `find client n/Amy` (Prints everyone of the name Amy)
* Acceptable Parameters
* Incomplete inputs for string searches work too
* Anything beyond p/ and r/ and n/does not work
* Anything beyond p/ and r/ and n/ does not work
* Name must be closely following / for more accurate output (eg. n/Amy vs n/ Amy)
* When command succeeds
* `These are the project members for the project <Project Name>` followed by list of project members
* `These are all the Senior Developers in this company` followed by list of senior developers
* `This is Amy’s contact` / `These are the contact details for Amy` followed by Amy’s details or list of all the Amy’s contact
`No relevant contact details can be found`
* When command fails
* Missing header<br> `Please search with the correct input Search p/<Project Name> OR Search r/<Role> OR Search n/<Name>`
* Invalid input<br> `x/ is not a valid type to search, Please search with the correct input Search p/<Project Name> OR Search r/<Role> OR Search n/<Name>`
* Missing header<br> `Please find with the correct input find p/<Project Name> OR find r/<Role> OR find n/<Name>`
* Invalid input<br> `x/ is not a valid type to find, Please find with the correct input find p/<Project Name> OR find r/<Role> OR find n/<Name>`

* Relevant UI mock-ups

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import seedu.address.logic.commands.CommandResult;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.Client.Client;
import seedu.address.model.client.Client;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.developer.Developer;
import seedu.address.model.project.Project;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/address/logic/LogicManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.logic.parser.AddressBookParser;
import seedu.address.logic.parser.exceptions.ParseException;
import seedu.address.model.Client.Client;
import seedu.address.model.client.Client;
import seedu.address.model.Model;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.developer.Developer;
import seedu.address.model.person.Person;
import seedu.address.model.project.Project;
import seedu.address.storage.Storage;

Expand Down
13 changes: 12 additions & 1 deletion src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import java.util.stream.Stream;

import seedu.address.logic.parser.Prefix;
import seedu.address.model.Client.Client;
import seedu.address.model.client.Client;
import seedu.address.model.developer.Developer;
import seedu.address.model.project.Project;

/**
* Container for user visible messages.
Expand Down Expand Up @@ -83,4 +84,14 @@ public static String format(Client client) {
client.getProjects().forEach(builder::append);
return builder.toString();
}

public static Object format(Project project) {
final StringBuilder builder = new StringBuilder();
builder.append(project.getName())
.append(";\nDescription: ")
.append(project.getProjectDescription().get())
.append(";\nDeadlines:\n");
project.getProjectDeadlines().forEach(builder::append);
return builder.toString();
}
}
99 changes: 99 additions & 0 deletions src/main/java/seedu/address/logic/commands/FindClientCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;

import java.util.function.Predicate;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.Messages;
import seedu.address.model.Model;
import seedu.address.model.client.Client;
import seedu.address.model.client.DocumentContainsKeywordsPredicate;
import seedu.address.model.client.OrganisationContainsKeywordsPredicate;
import seedu.address.model.person.AddressContainsKeywordsPredicate;
import seedu.address.model.person.EmailContainsKeywordsPredicate;
import seedu.address.model.person.KeywordPredicate;
import seedu.address.model.person.NameContainsKeywordsPredicate;
import seedu.address.model.person.Person;
import seedu.address.model.person.PhoneContainsKeywordsPredicate;
import seedu.address.model.person.ProjectContainsKeywordsPredicate;
import seedu.address.model.person.RoleContainsKeywordsPredicate;

/**
* Finds and lists all persons in address book whose name contains any of the argument keywords.
* Keyword matching is case insensitive.
*/
public class FindClientCommand extends Command {

public static final String COMMAND_WORD = "find-client";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Please Find with the correct input "
+ "Find pr/<Project Name> OR Find r/<Role> OR Find n/<Name>.\n"
+ "Example: " + COMMAND_WORD + " n/ alice bob charlie";

private KeywordPredicate<? extends Person> predicate;

public FindClientCommand(NameContainsKeywordsPredicate namePredicate) {
this.predicate = namePredicate;
}

public FindClientCommand(RoleContainsKeywordsPredicate rolePredicate) {
this.predicate = rolePredicate;
}

public FindClientCommand(AddressContainsKeywordsPredicate addressPredicate) {
this.predicate = addressPredicate;
}

public FindClientCommand(EmailContainsKeywordsPredicate emailPredicate) {
this.predicate = emailPredicate;
}

public FindClientCommand(PhoneContainsKeywordsPredicate phonePredicate) {
this.predicate = phonePredicate;
}


public FindClientCommand(ProjectContainsKeywordsPredicate projectPredicate) {
this.predicate = projectPredicate;
}

public FindClientCommand(DocumentContainsKeywordsPredicate documentPredicate) {
this.predicate = documentPredicate;
}

public FindClientCommand(OrganisationContainsKeywordsPredicate organisationPredicate) {
this.predicate = organisationPredicate;
}

@Override
public CommandResult execute(Model model) {
requireNonNull(model);
model.updateFilteredClientList((Predicate<Client>) predicate);
return new CommandResult(
String.format(Messages.MESSAGE_DEVELOPERS_LISTED_OVERVIEW, model.getFilteredDeveloperList().size()),TabIndex.Client);
}


@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}

// instanceof handles nulls
if (!(other instanceof FindClientCommand)) {
return false;
}

FindClientCommand otherFindClientCommand = (FindClientCommand) other;
return predicate.equals(otherFindClientCommand.predicate);
}

@Override
public String toString() {
return new ToStringBuilder(this)
.add("predicate", predicate)
.toString();
}
}
Loading

0 comments on commit 5eb1ad3

Please sign in to comment.