From 16a32c684fad7186dccdb05c677e0624f6d1c13b Mon Sep 17 00:00:00 2001 From: emzm2023 Date: Thu, 2 Nov 2023 15:17:58 +0800 Subject: [PATCH] Update UG and format to print deadlines --- docs/UserGuide.md | 156 ++++++------------ .../java/seedu/address/logic/Messages.java | 30 ++-- .../seedu/address/model/project/Deadline.java | 5 + 3 files changed, 71 insertions(+), 120 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index dadfd0b4185..c461a84c08d 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -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-). ------------------------------------------------------------------------------------------ @@ -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| @@ -153,8 +157,7 @@ Here are some notes about these parameters. ### 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…}` @@ -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. @@ -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 `@`. -* `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 does not follow the 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. @@ -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 `@`. -* `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. @@ -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) diff --git a/src/main/java/seedu/address/logic/Messages.java b/src/main/java/seedu/address/logic/Messages.java index 0ac2c6a4fc2..b23f06141ef 100644 --- a/src/main/java/seedu/address/logic/Messages.java +++ b/src/main/java/seedu/address/logic/Messages.java @@ -61,19 +61,19 @@ 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(); } @@ -81,19 +81,19 @@ public static String format(Developer developer) { 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(); } @@ -104,7 +104,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(); } } diff --git a/src/main/java/seedu/address/model/project/Deadline.java b/src/main/java/seedu/address/model/project/Deadline.java index d3ffeb45d8e..f00de75ffbe 100644 --- a/src/main/java/seedu/address/model/project/Deadline.java +++ b/src/main/java/seedu/address/model/project/Deadline.java @@ -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"); }