Skip to content

Commit

Permalink
Merge pull request #209 from itsme-zeix/update-tier-status
Browse files Browse the repository at this point in the history
Update Tier and Status constraints with Filter Command
  • Loading branch information
itsme-zeix authored Nov 7, 2024
2 parents 66f785c + 931e395 commit 34352d2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 19 deletions.
29 changes: 15 additions & 14 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ Find or create a folder on your computer where you want to store the AgentAssist
<img src="images/Ui.png" alt="UI" style="margin-top: 20px; margin-bottom: 20px;">


4. 🎉 **Congratulations! AgentAssist is now up and running!** You're all set to start using AgentAssist to manage your contacts, track your sales, and boost your productivity.
4. 🎉 **Congratulations! AgentAssist is now up and running!** 🎉
You're all set to start using AgentAssist to manage your client contacts, track your sales, and boost your productivity.

<div style="page-break-after: always;"></div>

Expand Down Expand Up @@ -169,6 +170,7 @@ Let's take a look at the structure in more detail:
| **Flag(s)** | Modifiers that specify what kind of data is being handled. <br/><br/>Flag(s) are typically 1-2 letters followed by a backslash. | `n/`, `e/`, `r/`, `rn/` |
| **Argument(s)** | The values or inputs the command uses, such as client data or specific details. <br><br> This guide may represent it as a placeholder using `<ARGUMENT>`. | `John Doe`, `[email protected]` |

Here's an example that uses multiple flags and arguments:
Here's an example that uses multiple flags and arguments:
```
add n/ John Doe e/ [email protected]
Expand All @@ -179,7 +181,7 @@ add n/ John Doe e/ [email protected]


## 4.2 Commands
A command is the action that AgentAssist will perform, such as adding, deleting, or editing a contact.
A command is the action that AgentAssist will perform, such as adding, deleting, or editing a client's contact.

Here is a reference table that briefly summarizes available commands:

Expand Down Expand Up @@ -233,7 +235,6 @@ Arguments are the values that follow each flag in a command. **Arguments cannot

Refer to the table below for more details.


| **Flag** | **Expected Argument** | **Description** | **Requirements** |
|----------|-----------------------|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| `n/` | `<NAME>` | The client's full name | Any combination of letters, numbers, spaces, hyphens, apostrophes (no symbols). |
Expand All @@ -242,13 +243,11 @@ Refer to the table below for more details.
| `a/` | `<ADDRESS>` | The client's physical address | Any combination of letters, numbers, spaces, and symbols. |
| `j/` | `<JOBNAME>` | The client's job title or profession | Any combination of letters, numbers, spaces, and symbols. |
| `i/` | `<INCOME>` | The client's annual income | Positive number or zero <br/> • Must be numeric<br/> • Cannot include commas and decimal points<br/> • Cannot be fractional |
| `t/` | `<TIER>` | The client's assigned tier level | Must be one of the predefined tiers:<br/> • Gold, Silver, Bronze, Reject, Na |
| `s/` | `<STATUS>` | The client's assigned status, indicating whether any followup action by the agent is needed. | Must be one of the predefined statuses:<br/> • Urgent, Non_urgent, Na |
| `t/` | `<TIER>` | The client's assigned tier level | Must be one of the predefined tiers:<br/> • `Gold`, `Silver`, `Bronze`, `Reject` or `NA` |
| `s/` | `<STATUS>` | The client's assigned status, indicating whether any followup action by the agent is needed. | Must be one of the predefined statuses:<br/> • `Urgent`, `Non_Urgent` or `NA` |
| `r/` | `<REMARK>` | General remark(s) about the client | Any combination of letters, numbers, spaces, and symbols. |
| `ra/` | `<REMARK TO APPEND>` | Append information to the existing remark(s) | Any combination of letters, numbers, spaces, and symbols. |
| `rn/` | `<NEW REMARK>` | Replaces the existing remark with a new remark | Any combination of letters, numbers, spaces, and symbols. |


**Note:** All of the above arguments are case-insensitive.

> 💡 **Pro Tip:**
Expand Down Expand Up @@ -290,8 +289,10 @@ The GUI will dynamically update to show the results of your commands, making it

Refer to the [Commands Section](#5-commands) for more comprehensive details of each command.

> 💡 **Pro Tip:**
> 💡 **Pro Tip:**
>
> Combine commands like `filter` followed by `edit` or `delete` to manage your contacts more effectively.
>
> For example, use `filter j/doctor` to display all doctors, then `edit 2 a/321 New Address` to update the address for the second listed doctor.
[↑ Return to Table of Contents](#table-of-contents)
Expand Down Expand Up @@ -381,7 +382,7 @@ For detailed explanations of each flag and acceptable arguments, refer to Sectio
```

> **Note on Duplicates:**
>
> AgentAssist will prevent duplicate entries if a client with the **same name, email and phone number** is already saved.
> When this happens, you will see the following message:
>
Expand Down Expand Up @@ -583,7 +584,7 @@ list
```
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.
- **Mandatory Field**: One or more flags with corresponding search terms. The search term cannot be left empty.
- **Special Syntax for Income (i/)**:
- When filtering by income, use comparison operators `=`, `>`, or `<` to specify criteria.
- Example: `i/ >5000` will filter clients with an income greater than 5000.
Expand Down Expand Up @@ -649,7 +650,7 @@ For detailed explanations of each flag and acceptable arguments, refer to Sectio
Parameters: <FLAG>/ <SEARCH TERM>
Flags: n/ NAME, p/ PHONE, e/ EMAIL, a/ ADDRESS, j/ JOB, r/ REMARK i/ (=/</>) INCOME s/ STATUS
Flags: n/ NAME, p/ PHONE, e/ EMAIL, a/ ADDRESS, j/ JOB, i/ (=/</>) INCOME r/ REMARK t/ TIER s/ STATUS
Example: filter n/ Alice p/ 91112222 i/ >2000
```
Expand Down Expand Up @@ -778,14 +779,14 @@ The data in AgentAssist is automatically saved as a [JSON](https://developer.moz
### How do I transfer my data to another Computer?
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 or credit card tier 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).
### 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.

### Why am I getting an error when trying to edit the remark of an existing client?
Ensure that the command syntax is correct, and note that the `rn/` and `ra/` flags cannot be used together. The `rn/` flag replaces the existing remark(s), while `ra/` appends to the current remark(s).

### What do the different tier colors represent in the UI?
Each credit card tier is visually distinguished in the UI: Gold is marked with a gold banner, Silver with a silver banner, Bronze with a bronze banner, and Reject with a red banner. This makes it easy to see at a glance the tier of each client.
Each credit card tier is visually distinguished in the UI: Gold is marked with a gold banner, Silver with a silver banner, Bronze with a bronze banner, and Reject with a maroon banner. This makes it easy to see at a glance the tier of each client.

### What do the different status colors represent in the UI?
Each status type is visually distinguished in the UI: Urgent is denoted by a red banner, Non_urgent with a yellow banner. This makes it easy to see at a glance the status of each client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class FilterCommand extends Command {
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Searches for all clients whose specified field "
+ "contains the given substring (case-insensitive) and displays the results in a numbered list.\n"
+ "Parameters: <FLAG>/ <SEARCH TERM>\n"
+ "Flags: n/ NAME, p/ PHONE, e/ EMAIL, a/ ADDRESS, j/ JOB, r/ REMARK i/ (=/</>) INCOME s/ STATUS\n"
+ "Flags: n/ NAME, p/ PHONE, e/ EMAIL, a/ ADDRESS, j/ JOB, i/ (=/</>) INCOME r/ REMARK t/ TIER s/ STATUS\n"
+ "Example: '" + COMMAND_WORD + " n/ Alice" + " p/ 91112222'\n"
+ "This will find all clients whose names contain 'Alice' and whose phone number is '91112222'.";

Expand Down
15 changes: 15 additions & 0 deletions src/main/java/seedu/address/logic/parser/FilterCommandParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
*/
public class FilterCommandParser implements Parser<FilterCommand> {

public static final String TIER_NO_VALUE_PROVIDED_MESSAGE = "Tier has not been provided any value to filter by.\n"
+ "Please specify a tier label to filter by, such as 'Gold', 'Silver', 'Bronze', 'Reject', or 'NA'.\n"
+ "To filter for clients without a visible tier label beside their name, use: filter t/ NA";

public static final String STATUS_NO_VALUE_PROVIDED_MESSAGE = "Status has not been provided any value "
+ "to filter by.\n"
+ "Please specify a status label to filter by, such as 'Urgent', 'Non_Urgent', or 'NA'.\n"
+ "To filter for clients without a visible status label beside their name, use: filter s/ NA";

/**
* Parses the given {@code String} of arguments in the context of the FilterCommand
* and returns a FilterCommand object for execution.
Expand Down Expand Up @@ -148,11 +157,17 @@ private List<Predicate<Client>> collectPredicates(ArgumentMultimap argMultimap)
if (argMultimap.getValue(PREFIX_TIER).isPresent()) {
String substring = parseFieldForFilterCommand(() -> parseField(() -> argMultimap.getValue(
PREFIX_TIER).get(), errors));
if (substring.isEmpty()) {
errors.add(TIER_NO_VALUE_PROVIDED_MESSAGE);
}
predicates.add(new TierStartsWithSubstringPredicate(substring));
}
if (argMultimap.getValue(PREFIX_STATUS).isPresent()) {
String substring = parseFieldForFilterCommand(() -> parseField(() -> argMultimap.getValue(
PREFIX_STATUS).get(), errors));
if (substring.isEmpty()) {
errors.add(STATUS_NO_VALUE_PROVIDED_MESSAGE);
}
predicates.add(new StatusStartsWithSubstringPredicate(substring));
}
if (!errors.isEmpty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/status/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class Status {

public static final String MESSAGE_CONSTRAINTS = "Status can be set to 'non_urgent' or 'urgent' or 'na'. "
public static final String MESSAGE_CONSTRAINTS = "Status must be set to Urgent, Non_Urgent, or NA. "
+ "Please use one of these options if specifying a status.";


Expand Down
3 changes: 1 addition & 2 deletions src/main/java/seedu/address/model/tier/Tier.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
* Guarantees: immutable; name is valid as declared in {@link #isValidTierName(String)}
*/
public class Tier {

public static final String MESSAGE_CONSTRAINTS = "Tier can be set to 'gold', 'silver', 'bronze', 'reject' or 'na'. "
public static final String MESSAGE_CONSTRAINTS = "Tier must be set to Gold, Silver, Bronze, Reject, or NA. "
+ "Please use one of these options if specifying a tier.";

public final TierEnum tierName;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static Client[] getSampleClients() {
new Status("NA")),
new Client(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("[email protected]"),
new Address("Blk 47 Tampines Street 20, #17-35"), new Job("Macs Burger Flipper"),
new Income(BigInteger.valueOf(20)), new Tier("REJECT"), new Remark(""),
new Income(BigInteger.valueOf(20)), new Tier("NA"), new Remark(""),
new Status("URGENT")),
new Client(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("[email protected]"),
new Address("Blk 45 Aljunied Street 85, #11-31"), new Job("PowerPoint Master"),
Expand Down

0 comments on commit 34352d2

Please sign in to comment.