Skip to content

Commit

Permalink
Merge pull request AY2324S1-CS2103T-T09-2#151 from emzm2023/update-ug
Browse files Browse the repository at this point in the history
Update UG and format to print deadlines
  • Loading branch information
mingyu-wan authored Nov 2, 2023
2 parents defe1c3 + 16a32c6 commit 8fbd769
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 120 deletions.
156 changes: 51 additions & 105 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ CodeContact is a **desktop app for managing contacts, optimized for use via a Co
## How can this guide help me?

If you are a new user, we hope to first inform you on how you can [get started](#quick-start) using CodeContact.

As you use CodeContact, you may also have questions on how to perform certain actions within the
application. This guide thus contains a comprehensive list of [Features](#features) offered with CodeContact, as well as
explanations on when and how to use them.

Further questions are also answered within a [FAQ](#faq) section below.

Confused about the terms or formatting used in this guide? Learn how to **navigate this guide** [here](#navigating-this-guide).

Confused about the visual display of CodeContact? Learn how to **navigate the user interface** of CodeContact
[here](#navigating-the-graphical-user-interface--gui-).
------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -89,9 +93,9 @@ Here are some notes about these parameters.
how to correct your command.

#### Common Parameters
| Parameter | Description | Constraints | Valid Examples | Invalid Examples |
|---|---|---|---|---|
|`n/`|Name of developer/client/project| alphanumeric characters and spaces, and it should not be blank | Tom Hanks, Elizabeth 2 | 成龍, 潔 いさぎ 世 よ 一 いち, Ganesh s/o Ravichandran|
| Parameter | Description | Constraints | Valid Examples | Invalid Examples |
|---|----------------------------------|---|---|---|
|`n/`| name of developer/client/project | alphanumeric characters and spaces, and it should not be blank | Tom Hanks, Elizabeth 2 | 成龍, 潔 いさぎ 世 よ 一 いち, Ganesh s/o Ravichandran|



Expand Down Expand Up @@ -153,8 +157,7 @@ Here are some notes about these parameters.
</div>

### Adding new information : `add`
* What it does:
* Manager can add a new employee to the list of people into the data one by one
Manager can add a new employee to the list of people into the data one by one.
* Format
* `create new employee`
* `n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS d/DATE_JOINED r/ROLE s/SALARY pr/{PROJECT1, PROJECT2…}`
Expand Down Expand Up @@ -197,6 +200,25 @@ Here are some notes about these parameters.
* `Error! New user’s {MISSING_PARTICULARS} are missing.`
* Relevant UI mock-ups

### Main feature
#### developer specific feature
Description of what feature does.

Format: `command format`
* notes about command eg. at least one of the optional fields must be provided etc.

Example of usage: `example`
* what the example does eg. Edits `Amy`'s phone number to `98989898` and changes the projects assigned to her to `Project2` and `Project3`.

When command succeeds, CLI shows:
```
Edited Client:
etc
```

#### client specific feature
etc.

### Edit
#### Edit developer details
Edits the details of an existing developer in the address book.
Expand All @@ -208,58 +230,23 @@ Format: `edit-developer INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [d
* Existing values will be updated to the input values.
* When editing projects, the existing assigned projects of the developer will be removed ie. adding of projects is not cumulative.
* You can remove all the developer's projects by typing `p/` without specifying any project name after it.

Example of usage: `edit-developer 2 p/98989898 pr/Project2 pr/Project3`
* Edits `AMY`'s phone number to `98989898` and changes the projects assigned to her to `Project2` and `Project3`.

Acceptable parameters:
* `INDEX` must be a positive integer.
* `NAME` and `PROJECT_NAME` can only consist of capital and small letters, spaces and hyphens.
* `NAME` cannot be the same as another existing developer's name in the address book.
* `PHONE_NUMBER` has to 8 digits without spaces.
* `EMAIL` has to be of the format `<TEXT>@<TEXT>`.
* `DATE_JOINED` has to be of format `dd-MM-yyyy` (e.g. `31-12-2019`).
* `ROLE` has to be.......??
* `SALARY` has to be at least 4 digits.
* `PROJECT_NAME` should be the name of an existing project.

When command succeeds, CLI shows: (??)
Example of usage: `edit-developer 2 p/98989898 pr/Project2 pr/Project3`
* Edits `Amy`'s phone number to `98989898` and changes the projects assigned to her to `Project2` and `Project3`.

When command succeeds, CLI shows:
```
Here are the updated employee details:
Name: AMY
Contact Number: 98989898
Edited Developer: Amy
Phone: 98989898
Email: amy@u.nus.edu
Address: NUS UTOWN
Date Joined: 06-09-2023
Role: Developer
Salary: 6999
Assigned Projects: Project1, Project2
Projects: Project1, Project2
```
* When command fails
* Repetitive name
* `More than 1 developer with the NAME has been found, please input employee’s phone number:`
* Invalid input
* `Please input the employee details in the right format`
* No access error
* `You do not have access to modify this. Please contact your administrator.`
* Format error
* `Error! New user’s <PARTICULAR> does not follow the format: <FORMAT>`
* E.x.: `Error! New user’s name does not follow the format:
Names can only consist of capital and small letters, spaces and hyphens.`

When command fails due to an error, the respective error message will be displayed:
* Non-existent developer
* `There is no employee with that name!`
* Non-existent project
* `There is no project with that name!`
* Invalid command format
* `Please input the employee details in the correct format!`
* No edits in input command
* `At least one field to edit must be provided!`
* Invalid command target
* `Invalid command target! You cannot call edit-d on the target.`

Relevant UI mock-ups (???)

#### Edit client details
Edits the details of an existing client in the address book.
Expand All @@ -272,42 +259,20 @@ Format: `edit-client INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [pr/P
* When editing projects, the existing assigned projects of the client will be removed ie. adding of projects is not cumulative.
* You can remove all the client's projects by typing `p/` without specifying any project name after it.

Example of usage: `edit-client 3 p/bob@gmail.com`
* Edits `BOB`'s email to `bob@gmail.com`.
Example of usage: `edit-client 3 e/bob@gmail.com`
* Edits `Bob`'s email to `bob@gmail.com`.

Acceptable parameters:
* `INDEX` must be a positive integer.
* `NAME`, `PROJECT_NAME` and `ORGANISATION` can only consist of capital and small letters, spaces and hyphens.
* `NAME` cannot be the same as another existing client's name in the address book.
* `PHONE_NUMBER` has to 8 digits without spaces.
* `EMAIL` has to be of the format `<TEXT>@<TEXT>`.
* `PROJECT_NAME` should be the name of an existing project.

When command succeeds, CLI shows: (??)
When command succeeds, CLI shows:
```
Here are the updated employee details:
Name: BOB
Contact Number: 87654321
Email: bob@gmail.com
Address: Blk 123 Banana Road
Projects: Project1
Organisation: Banana
Edited Client: Bob;
Phone: 87654321;
Email: bob@gmail.com;
Address: Blk 123 Banana Road;
Organisation: Google;
Document: google.com
Projects: ProjectA
```

When command fails due to an error, the respective error message will be displayed:
* Non-existent client
* `There is no client with that name!`
* Non-existent project
* `There is no project with that name!`
* Invalid command format
* `Please input the client details in the correct format!`
* No edits in input command
* `At least one field to edit must be provided!`
* Invalid command target
* `Invalid command target! You cannot call edit-d on the target.`

Relevant UI mock-ups (???)

#### Edit project details
Edits the details of an existing project in the address book.

Expand All @@ -320,36 +285,17 @@ Format: `edit-project INDEX [desc/DESCRIPTION] [d/DEADLINE]...`
* You can remove all the current deadlines by typing `d/` without specifying any deadline.
* The name of a project cannot be edited.

Example of usage: `edit-project 1 d/Finish Feature-A by: 09-09-2023`
* Deletes existing project deadlines and adds new deadline `Finish Feature-A by: 09-09-2023`
Example of usage: `edit-project 1 dl/19-12-2023,Design backend,HIGH,0`
* Deletes existing project deadlines and adds new deadline `Design backend by: 19-12-2023, priority: HIGH (undone)`

Acceptable parameters:
* `INDEX` must be a positive integer.
* `DEADLINE` should be of the format `DEADLINE_DESCRIPTION by: DATE`, where `DATE` is in `dd-MM-yyyy` format.

When command succeeds, CLI shows: (??)
When command succeeds, CLI shows:
```
Here are the updated project details:
Name: Project1
Description: Project1's deliverable is a CLI chatbot to manage tasks.
Deadlines:
1. Finish Feature-A by: 09-09-2023
2. Finish Feature-B by: 20-09-2023
3. Release first iteration by: 30-09-2023.
Edited Project: JuiceApp;
Description: Juice ordering app;
Deadlines:
1. Design backend by: 19-12-2023, priority: HIGH (undone)
```

When command fails due to an error, the respective error message will be displayed:
* Non-existent project
* `There is no project with that name!`
* Invalid command format
* `Please input the project details in the correct format!`
* No edits in input command
* `At least one field to edit must be provided!`
* Invalid command target
* `Invalid command target! You cannot call edit-developers on the target.`

Relevant UI mock-ups (???)

### Find according to type and industry details: `Find`
* What it does
* 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)
Expand Down
30 changes: 15 additions & 15 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,39 @@ public static String getErrorMessageForDuplicatePrefixes(Prefix... duplicatePref
public static String format(Developer developer) {
final StringBuilder builder = new StringBuilder();
builder.append(developer.getName())
.append("; Phone: ")
.append("; \nPhone: ")
.append(developer.getPhone())
.append("; Email: ")
.append("; \nEmail: ")
.append(developer.getEmail())
.append("; Address: ")
.append("; \nAddress: ")
.append(developer.getAddress())
.append("; Date Joined: ")
.append("; \nDate Joined: ")
.append(developer.getDateJoined())
.append("; Role: ")
.append("; \nRole: ")
.append(developer.getRole())
.append("; Salary: ")
.append("; \nSalary: ")
.append(developer.getSalary())
.append("; Projects: ");
.append("; \nProjects: ");
developer.getProjects().forEach(builder::append);
return builder.toString();
}

public static String format(Client client) {
final StringBuilder builder = new StringBuilder();
builder.append(client.getName())
.append("; Phone: ")
.append("; \nPhone: ")
.append(client.getPhone())
.append("; Email: ")
.append("; \nEmail: ")
.append(client.getEmail())
.append("; Address: ")
.append("; \nAddress: ")
.append(client.getAddress())
.append("; Organisation: ")
.append("; \nOrganisation: ")
.append(client.getOrganisation())
.append("; Role: ")
.append("; \nRole: ")
.append(client.getRole())
.append("; Document: ")
.append("; \nDocument: ")
.append(client.getDocument())
.append("; Projects: ");
.append("; \nProjects: ");
client.getProjects().forEach(builder::append);
return builder.toString();
}
Expand All @@ -105,7 +105,7 @@ public static Object format(seedu.address.model.project.Project project) {
.append(";\nDescription: ")
.append(project.getProjectDescription())
.append(";\nDeadlines:\n");
project.getProjectDeadlines().forEach(t -> builder.append(t.getStringRepresentation()));
project.getProjectDeadlines().forEach(t -> builder.append(t.getPrintedStringRepresentation()).append("\n"));
return builder.toString();
}

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/seedu/address/model/project/Deadline.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public boolean equals(Object other) {
&& priority.equals(otherDeadline.priority);
}

public String getPrintedStringRepresentation() {
return "" + num + ". " + desc.toString() + " by: " + date.toString() + ", priority: " + priority.toString()
+ " (" + (isDone? "done)" : "undone)");
}

public String getStringRepresentation() {
return date.toString()+","+desc.toString()+","+priority.toString()+","+(isDone? "1" : "0");
}
Expand Down

0 comments on commit 8fbd769

Please sign in to comment.