Skip to content

Commit

Permalink
Merge pull request #321 from FionaQY/fix-prefix-space
Browse files Browse the repository at this point in the history
Update UG, DG and HelpWindow
  • Loading branch information
FionaQY authored Nov 11, 2024
2 parents fda1c69 + 9bfafb3 commit 95b1a5d
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 86 deletions.
52 changes: 35 additions & 17 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,8 @@ There are a total of 3 checks that occur:
- **Flag Validation:** Checks that all required flags are present and that there are no invalid flags.
- **Value Validation:** Checks that the values provided for each specified flag are valid.
- **Duplicate Check:** Checks that there is no existing client with the same details (same `name`, `phone` and `email`) to prevent duplicate entries.
![AddActivityDiagram-Add_Activity_Diagram.png]

(images%2FAddActivityDiagram-Add_Activity_Diagram.png)
![AddActivityDiagram.png](images%2FAddActivityDiagram.png)

Note: The error messages shown will differ based on which check fails. The checks also occur in the same sequential order that they are listed in above.

Expand Down Expand Up @@ -225,7 +224,7 @@ To execute the delete command, users must specify a valid client index from the
1. The index is a **positive number**.
2. The index is **within the bounds** of the currently viewed client list.

Here is a high-level view of the methods involved when the `delete` command is executed, and the user approves of the deletion after a confirmation prompt is showed.
Here is a high-level view of the methods involved when the user inputs `delete 1`, and approves of the deletion after a confirmation prompt is showed.
![DeleteSequenceDiagram.png](images%2FDeleteSequenceDiagram.png)

This follows the activity diagram shown below:
Expand Down Expand Up @@ -312,7 +311,14 @@ These requirements can be restrictive for agents who may prefer more flexible fi

**Status:** Scheduled for future release due to current timeline priorities.

### 5. Warning for Edit Commands with Inputs Identical to Current Values
### 7. Prevent Duplicate Client Entries by Standardizing Name Formatting
**Current issue:** Duplicate client entries can occur when minor differences in whitespace are present in names due to user input errors (e.g., `John Doe` vs. `John Doe`). These variations, often caused by unintentional typos when using the `add` or `edit` commands, are currently treated as distinct entries.

**Proposed Enhancement:** Standardize client names by trimming excess whitespace from each part of the name before storing and comparing entries. This ensures that variations in spacing do not create duplicates.

**Status:** Scheduled for future release due to current timeline priorities.

### 8. Warning for Edit Commands with Inputs Identical to Current Values
**Current issue:** Users are not warned when the inputs for the `edit` command are the identical to the current values, resulting in no changes.

**Proposed Enhancement:** Add a confirmation prompt when the inputs are verified to make no changes to the client.
Expand Down Expand Up @@ -505,16 +511,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case ends.

**Use case: U7 - Remove all remarks about a client**

**MSS**

1. User performs <u> Edit remarks about a client (U4)</u>.
2. User removes all existing remarks through editing.

Use case ends.

**Use case: U8 - Clear clients' contacts**
**Use case: U7 - Clear clients' contacts**

**MSS**

Expand All @@ -533,7 +530,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case ends.

**Use case: U9 - Undo the most recent change**
**Use case: U8 - Undo the most recent change**

**MSS**
1. User requests to undo the last change made to the list of contacts.
Expand All @@ -549,7 +546,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case ends.

**Use case: U10 - Exit**
**Use case: U9 - Exit**

**MSS**

Expand Down Expand Up @@ -621,7 +618,28 @@ testers are expected to do more *exploratory* testing.
1. Re-launch the app by double-clicking the jar file.<br>
Expected: The most recent window size and location is retained.

1. _{ more test cases …​ }_
### Adding a client

1. Adding a new client to AgentAssist

1. Prerequisites: There must not be an existing client with the same name, phone number and email as the new client.

2. Test case: `add n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME>`<br>
Expected: A client with the given details is added to the end of the list of clients. Details are shown in the results box and any details that are truncated can be seen by using the `view` command with the client's displayed index.

3. Test case: `add n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> t/ <TIER> r/ <REMARK> s/ Status`<br>
Expected: A client with the given details, including the optional ones, is added to the end of the list of clients. Similar to previous.

4. Missing compulsory fields: `add n/ <NAME> p/ <PHONE>`, `add n/ <NAME> p/ <PHONE> e/ <EMAIL>`, `...` <br>
Expected: An error message is shown to user. No client is added. Missing fields are shown in the error message.

5. Invalid command formats: `add`, `add n/ <NAME> p/ <INVALID_PHONE> e/ E/ <EMAIL>...`, `...` <br>
Expected: An error message is shown to user. No client is added. Error details shown in the status message.

2. Add an existing client
1. Prerequisites: There exists a client in AddressBook which has the same name, phone number and email as the client to be added.
2. Test case: `add n/ <SAME_NAME> p/ <SAME_PHONE> e/ <SAME_EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME>` (where <SAME_NAME>, <SAME_PHONE> and <SAME_EMAIL> are the name, phone number and email of an existing client) <br>
Expected: An error message indicating that the client already exists is shown to user. No client is added.

### Deleting a client

Expand Down
77 changes: 43 additions & 34 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Some initial commands to try:
* `add n/ Jane Doe p/ 87654321 e/ [email protected] a/ 123 Jane Road j/ doctor i/ 120000`: Adds Jane Doe to your database with detailed contact information, job title, and income.

**Editing a Client's Information**
* `edit 1 p/ 12345678`: Updates the phone number of the first client in your list to `12345678`.
* `edit 1 p/ 92345678`: Updates the phone number of the first client in your list to `92345678`.
* `edit 4 rn/ Updated remark(s) here`: Replaces the remark(s) of the fourth client with "Updated remark(s) here".

**Removing a Client**
Expand Down Expand Up @@ -450,18 +450,18 @@ Refer to Sections [4.3 Flags](#43-flags) and [4.4 Arguments](#44-arguments), for
```
The following mandatory prefixes are missing: [...]
Invalid command format!
add: Adds a client to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS j/JOB i/INCOME [t/TIER]...
[r/REMARK]...[s/STATUS]...
Example: 'add n/John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2, #02-25 j/doctor i/300 t/GOLD r/He is very smart s/NON_URGENT'
add: Adds a client to the address book. Parameters: n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> [t/ <TIER>]...
[r/ <REMARK>]...[s/ <STATUS>]...
Example: 'add n/ John Doe p/ 98765432 e/ [email protected] a/ 311, Clementi Ave 2, #02-25 j/ doctor i/ 300 t/ GOLD r/ He is very smart s/ NON_URGENT'
```
- Error caused by invalid values for some fields
- Message:
```
Invalid command format!
<INDIVIDUAL FIELD'S ERROR MESSAGES>...
add: Adds a client to the address book. Parameters: n/NAME p/PHONE e/EMAIL a/ADDRESS j/JOB i/INCOME [t/TIER]...
[r/REMARK]...[s/STATUS]...
Example: 'add n/John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2, #02-25 j/doctor i/300 t/GOLD r/He is very smart s/NON_URGENT'
add: Adds a client to the address book. Parameters: n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> [t/ <TIER>]...
[r/ <REMARK>]...[s/ <STATUS>]...
Example: 'add n/ John Doe p/ 98765432 e/ [email protected] a/ 311, Clementi Ave 2, #02-25 j/ doctor i/ 300 t/ GOLD r/ He is very smart s/ NON_URGENT'
```
> **Note on Duplicates:**
Expand Down Expand Up @@ -536,8 +536,8 @@ For detailed explanations of each flag and acceptable arguments, refer to Sectio
Invalid command format!
edit: Edits the details of the client identified by the index number used in the displayed client list. Existing values will be overwritten by the input values. Any fields unspecified will not be modified.
Required Parameters: INDEX (must be a positive integer)
Optional Parameters: [n/ NAME] [p/ PHONE] [e/ EMAIL] [a/ ADDRESS] [j/ JOB] [i/ INCOME] [t/ TIER] [rn/ NEW REMARK] [ra/ ADD-ON TO EXISTING REMARK] [s/ STATUS]
Example Usage: 'edit 1 p/91234567 e/[email protected]'
Optional Parameters: [n/ <NAME>] [p/ <PHONE>] [e/ <EMAIL>] [a/ <ADDRESS>] [j/ <JOB>] [i/ <INCOME>] [t/ <TIER>] [rn/ <NEW REMARK>] [ra/ <REMARK TO BE APPENDED>] [s/ <STATUS>]
Example Usage: 'edit 1 p/ 91234567 e/ [email protected]'
```
- Error caused by invalid values for some fields
- Message:
Expand All @@ -549,7 +549,7 @@ For detailed explanations of each flag and acceptable arguments, refer to Sectio
> 💡 **Pro Tip:**
> No need to worry about duplicate indexes—AgentAssist guarantees that every client has a unique index automatically.
- **Note:** If the value for `Tier`, `Status` or `REMARK` is the default value (`NA`), they will not be shown.
- This can be used to remove all remarks for a given client: `edit <INDEX> rn/NA` .
- This can be used to remove all remarks for a given client: `edit <INDEX> rn/ NA` .
Expand Down Expand Up @@ -591,10 +591,14 @@ For detailed explanations of each flag and acceptable arguments, refer to Sectio
Command has been cancelled.
```
- **On Error:**
- Invalid index error message:
```
The client index provided is invalid.
```
- Error caused by invalid index
- Message:
```
Invalid command format!
delete: : Deletes the client identified by the index number used in the displayed client list.
Parameters: INDEX (must be a positive integer)
Example: 'delete 1'
```
> 💡 **Pro Tip:**
> No need to worry about duplicate indexes—AgentAssist guarantees that every client has a unique index automatically.
Expand All @@ -604,7 +608,7 @@ For detailed explanations of each flag and acceptable arguments, refer to Sectio
### 5.2.4 Delete All Existing Clients
**Purpose:** Delete all clients from the database, effectively resetting the application’s contact list
**Purpose:** Delete all clients from the database, effectively resetting the application’s contact list.
**Command Format:**
```
Expand Down Expand Up @@ -651,7 +655,7 @@ list
**Command Format:**
```
filter [n/<NAME>] [p/<PHONE>] [e/<EMAIL>] [a/<ADDRESS>] [j/<JOB>] [r/<REMARK>] [t/<TIER>] [i/ (=/</>) <INCOME>] [s/<STATUS>]
filter [n/ <NAME>] [p/ <PHONE>] [e/ <EMAIL>] [a/ <ADDRESS>] [j/ <JOB>] [r/ <REMARK>] [t/ <TIER>] [i/ (=/</>) <INCOME>] [s/ <STATUS>]
```
- **Mandatory Field**: One or more flags with corresponding search terms. The search term cannot be left empty.
- **Special Syntax for Income (i/)**:
Expand Down Expand Up @@ -722,14 +726,15 @@ For detailed explanations for the matching criteria of each flag and the accepta
where `x` is the number of matching results.
- **On Error:**
- If no valid flags are used:
```
Invalid command format!
filter: Searches for all clients whose specified field contains the given substring (case-insensitive) and displays the results in a numbered list.
Parameters: <FLAG>/ <SEARCH TERM>
Flags: n/ NAME, p/ PHONE, e/ EMAIL, a/ ADDRESS, j/ JOB, i/ (=/</>) INCOME r/ REMARK t/ TIER s/ STATUS
Example: filter n/ Alice p/ 9111222
This will find all clients whose names contain 'Alice' and whose phone number is '91112222'.
```
- Message:
```
Invalid command format!
filter: Searches for all clients whose specified field contains the given substring (case-insensitive) and displays the results in a numbered list.
Parameters: <FLAG>/ <SEARCH TERM>
Flags: n/ <NAME>, p/ <PHONE>, e/ <EMAIL>, a/ <ADDRESS>, j/ <JOB>, i/ (=/</>) <INCOME> r/ <REMARK> t/ <TIER> s/ <STATUS>
Example: filter n/ Alice p/ 9111222
This will find all clients whose names contain 'Alice' and whose phone number is '91112222'.
```
- If a search term fails to meet the requirements (e.g., invalid phone number length), the system will display usage hints specific to all the invalid search terms.
Expand Down Expand Up @@ -761,10 +766,14 @@ view <INDEX>
- A split view opens showing the selected client's complete information
- The main list remains visible and functional on the left while detailed information appears on the right
- **On Error:**
- Invalid index error message:
```
The client index provided is invalid.
```
- Error caused by invalid index
- Message:
```
Invalid command format!
view: Views the client identified by the index number used in the displayed client list.
Parameters: INDEX (must be a positive integer)
Example: 'view 1'
```
> 💡 **Pro Tip:**
> You can use the split view to compare client details side by side with the main list, making it easier to reference multiple clients at once.
Expand All @@ -783,10 +792,10 @@ close
**What to Expect:**
- **On Success:**
- The split view closes
- The main list view returns to full width
- The split view closes.
- The main list view returns to full width.
- **On Error:**
- No error messages are shown; the command is simply ignored if no split view is open
- No error messages are shown; the command is simply ignored if no split view is open.
### 5.4.3 Undo Previous Command
Expand Down Expand Up @@ -873,7 +882,7 @@ The window size settings for AgentAssist is automatically saved as a [JSON](http
Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous AgentAssist home folder.
### How do I change the remarks, credit card tier, or status of an existing client?
Use the [`edit` command](#522-edit-an-existing-clients-information), and specify the `t/` flag for the credit card tier, and `rn/` or `ra/` for remark(s). If you wish to remove the visible `Tier` or `Status` label of a client, use `t/ NA` or `s/ NA` with the `edit` command.
Use the [`edit` command](#522-edit-an-existing-clients-information), and specify the `t/` flag for the credit card tier, and `rn/` or `ra/` for remark(s). If you wish to remove the visible `Tier` or `Status` label of a client, use `t/ NA` or `s/ NA` with the `edit` command. To remove all remarks of a client, use `rn/ NA` with the `edit` command.
**Note**: If you append to a remark with the value `NA` (an empty remark), it will be replaced with the new remark, without any blank lines appearing.
Expand Down Expand Up @@ -906,11 +915,11 @@ Each credit card tier and client status is visually distinguished in the UI with
| **Action** | **Command Format** | **Example** |
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| **Add New Client** | `add n/<NAME> p/<PHONE> e/<EMAIL> a/<ADDRESS> j/<JOB> i/<INCOME> [t/<TIER>] [r/<REMARK>] [s/<STATUS>]` | `add n/ GORDON MOORE p/ 99007766 e/ [email protected] a/ COM3 j/ engineer i/ 99999 t/ gold r/ remark s/ urgent` |
| **Add New Client** | `add n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> [t/ <TIER>] [r/ <REMARK>] [s/ <STATUS>]` | `add n/ GORDON MOORE p/ 99007766 e/ [email protected] a/ COM3 j/ engineer i/ 99999 t/ gold r/ remark s/ urgent` |
| **Delete Existing Client** | `delete <INDEX>` | `delete 69` |
| **Edit Existing Client** | `edit <INDEX> [n/ <NAME>] [p/ <PHONE>] [e/ <EMAIL>] [a/ <ADDRESS>] [j/ <JOB>] [i/ <INCOME>] [t/ <TIER>] [rn/ <NEW REMARK>] [ra/ <REMARK TO BE APPENDED>] [s/ <STATUS>]` | `edit 69 n/ GORDON MOORE p/ 77337733 e/ [email protected] a/ COM3 j/ doctor i/ 1000000000 ra/ added info s/ urgent` |
| **List All Clients** | `list` | `list` |
| **Filter Client List** | `filter [n/<NAME>] [p/<PHONE>] [e/<EMAIL>] [a/<ADDRESS>] [j/<JOB>] [r/<REMARK>] [t/<TIER>] [i/ (=/</>) <INCOME>] [s/<STATUS>]` | `filter n/ GORDON MOORE j/ doctor t/ gold s/ urgent` |
| **Filter Client List** | `filter [n/ <NAME>] [p/ <PHONE>] [e/ <EMAIL>] [a/ <ADDRESS>] [j/ <JOB>] [r/ <REMARK>] [t/ <TIER>] [i/ (=/</>) <INCOME>] [s/ <STATUS>]` | `filter n/ GORDON MOORE j/ doctor t/ gold s/ urgent` |
| **View Client Details** | `view <INDEX>` | `view 1` |
| **Close Client Details** | `close` | `close` |
| **Clear All Data** | `clear` | `clear` |
Expand Down
4 changes: 2 additions & 2 deletions docs/diagrams/AddSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end box
[-> LogicManager : execute add new client
activate LogicManager

LogicManager -> AgentAssistParser : parse add command
LogicManager -> AgentAssistParser : parseCommand(userInput)
activate AgentAssistParser

create AddCommandParser
Expand All @@ -27,7 +27,7 @@ activate AddCommandParser
AddCommandParser --> AgentAssistParser
deactivate AddCommandParser

AgentAssistParser -> AddCommandParser : parse add command
AgentAssistParser -> AddCommandParser : parse(args)
activate AddCommandParser

create AddCommand
Expand Down
Binary file modified docs/images/AddSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 95b1a5d

Please sign in to comment.