Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch refine output message #248

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,20 @@ public class AddCommand extends Command {
+ PREFIX_EMAIL + "EMAIL "
+ PREFIX_ADDRESS + "ADDRESS "
+ PREFIX_DESCRIPTION + "DESCRIPTION "
+ PREFIX_CLIENT_TYPE + "CLIENT_TYPE...\n"
+ PREFIX_CLIENT_TYPE + "CLIENT_TYPE\n"
+ "Example: " + COMMAND_WORD + " "
+ PREFIX_NAME + "John Doe "
+ PREFIX_PHONE + "98765432 "
+ PREFIX_EMAIL + "[email protected] "
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 "
+ PREFIX_CLIENT_TYPE + "Plan A "
+ PREFIX_CLIENT_TYPE + "Plan B "
+ PREFIX_DESCRIPTION + "Likes to eat a lot ";
+ PREFIX_DESCRIPTION + "Likes to eat a lot \n"
+ "Additional Info:\n"
+ "- Can add multiple c/ to add multiple CLIENT_TYPE\n";

public static final String MESSAGE_SUCCESS = "New client added: %1$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This name already exists in the client hub. If the "
public static final String MESSAGE_DUPLICATE_PERSON = "This name already exists in Client Hub. If the "
+ "newly added client has the same name, Please add use () to add more information after the name "
+ "to differentiate the names.";

Expand Down
12 changes: 7 additions & 5 deletions src/main/java/seedu/address/logic/commands/DeleteCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ public class DeleteCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the client identified by their name in the displayed client list.\n"
+ "Parameters: Name (String & must be non-empty)\n"
+ "Example: " + COMMAND_WORD + " John Doe " + " " + " or " + " "
+ " Example: " + SHORT_COMMAND_WORD + " John Doe \n"
+ "To delete a client with a common name, please provide fullname or use /"
+ " to indicate the end of the name eg Jon snow/ \n";
+ "Parameters: NAME (String & must be non-empty)\n"
+ "Example: " + COMMAND_WORD + " John Doe "
+ " or " + " "
+ SHORT_COMMAND_WORD + " John Doe \n"
+ "Additional Info: \n"
+ "- To delete a client with a common name, please provide fullname or\n"
+ "use / to indicate the end of the name eg Jon snow/";

public static final String MESSAGE_DELETE_PERSON_SUCCESS = "Deleted Client: %1$s";

Expand Down
16 changes: 12 additions & 4 deletions src/main/java/seedu/address/logic/commands/FindAddressCommand.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.Messages;
Expand All @@ -15,10 +16,17 @@ public class FindAddressCommand extends Command {

public static final String COMMAND_WORD = "fa";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all clients whose address contain any of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\n"
+ "Example: " + COMMAND_WORD + " tampines";
public static final String MESSAGE_USAGE = FindCommand.COMMAND_WORD + " " + PREFIX_ADDRESS
+ " or " + COMMAND_WORD
+ ": Finds all clients whose address contain any of "
+ "the specified ADDRESS and displays them as a list with index numbers.\n"
+ "Parameters: ADDRESS\n"
+ "Example:\n"
+ "- " + COMMAND_WORD + " tampines\n"
+ "- " + FindCommand.COMMAND_WORD + " " + PREFIX_ADDRESS + "tampines\n"
+ "Additional Info: \n"
+ "- ADDRESS is case-insensitive.\n"
+ "- ADDRESS should not be empty.";

private final AddressContainsKeywordsPredicate predicate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CLIENT_TYPE;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.Messages;
Expand All @@ -16,10 +17,20 @@ public class FindClientTypeCommand extends Command {

public static final String COMMAND_WORD = "fc";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all clients whose names contain any of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
public static final String MESSAGE_USAGE = FindCommand.COMMAND_WORD + " " + PREFIX_CLIENT_TYPE
+ " or " + COMMAND_WORD
+ ": Finds all clients whose names contain any of "
+ "the specified CLIENT_TYPE and displays them as a list with index numbers.\n"
+ "Parameters: CLIENT_TYPE [MORE_CLIENT_TYPES]...\n"
+ "Example: " + COMMAND_WORD + "Investment Plan 1";
+ "Examples: \n"
+ COMMAND_WORD + " Investment Plan\n"
+ COMMAND_WORD + " Investment Plan Healthcare\n"
+ FindCommand.COMMAND_WORD + " " + PREFIX_CLIENT_TYPE + "Investment Plan\n"
+ FindCommand.COMMAND_WORD + " " + PREFIX_CLIENT_TYPE + "Investment Plan Healthcare\n"
+ "Additional Info: \n"
+ "- CLIENT_TYPE is case-insensitive.\n"
+ "- CLIENT_TYPE should not be empty.\n"
+ "- Can specify multiple CLIENT_TYPE to have a more specific find.";


private final ClientTypeContainsKeywordsPredicate predicate;
Expand Down
18 changes: 8 additions & 10 deletions src/main/java/seedu/address/logic/commands/FindCommand.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS;
import static seedu.address.logic.parser.CliSyntax.PREFIX_CLIENT_TYPE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.Messages;
Expand All @@ -22,12 +18,14 @@ public class FindCommand extends Command {
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds clients whose name, phone number, "
+ "address or client type contain any of "
+ "all specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters: n/NAME, p/PHONE_NUMBER, a/ADDRESS, c/CLIENT_TYPE \n"
+ "Examples: \n"
+ COMMAND_WORD + " " + PREFIX_NAME + " alice wong\n"
+ COMMAND_WORD + " " + PREFIX_PHONE + " 91234567\n"
+ COMMAND_WORD + " " + PREFIX_ADDRESS + " 123, Jurong West Ave 6\n"
+ COMMAND_WORD + " " + PREFIX_CLIENT_TYPE + " Investment Plan 1";
+ "Parameters: n/NAME or p/PHONE_NUMBER, or a/ADDRESS or c/CLIENT_TYPE\n"
+ "Examples:\n"
+ "- " + COMMAND_WORD + " alice wong\n"
+ "- " + COMMAND_WORD + " p/91234567\n"
+ "- " + COMMAND_WORD + " a/123, Jurong West Ave 6\n"
+ "- " + COMMAND_WORD + " c/Investment Plan 1\n"
+ "Additional Info:\n"
+ "- The command can only take in one prefix at any point of time. (find n/NAME a/Address is invalid)\n";

private final NameContainsKeywordsPredicate predicate;

Expand Down
19 changes: 13 additions & 6 deletions src/main/java/seedu/address/logic/commands/FindNameCommand.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.Messages;
Expand All @@ -15,12 +16,18 @@ public class FindNameCommand extends Command {

public static final String COMMAND_WORD = "fn";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all clients whose names contain all of "
+ "the prefix of the specified keywords and displays them as a list with index numbers. The keywards are "
+ "case-insensitive. They should contain letters,spaces and parenthesis only. They cannot be empty or have "
+ "only spaces\n"
+ "Parameters: KEYWORDS\n"
+ "Example: " + COMMAND_WORD + "alice";
public static final String MESSAGE_USAGE = FindCommand.COMMAND_WORD + " " + PREFIX_NAME
+ " or " + COMMAND_WORD
+ ": Finds all clients whose names contain all of "
+ "the prefix of the specified NAME and displays them as a list with index numbers.\n"
+ "Parameters: NAME (String & must be non-empty)\n"
+ "Example:\n"
+ "- " + COMMAND_WORD + " Alice\n"
+ "- " + FindCommand.COMMAND_WORD + " " + PREFIX_NAME + "Alice\n"
+ "Additional Info: \n"
+ "- NAME is case-insensitive.\n"
+ "- It should contain letters, spaces, parenthesis or slashes only.\n"
+ "- They cannot be empty or have only spaces.";

private final NameContainsKeywordsPredicate predicate;

Expand Down
16 changes: 12 additions & 4 deletions src/main/java/seedu/address/logic/commands/FindPhoneCommand.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.Messages;
Expand All @@ -15,10 +16,17 @@ public class FindPhoneCommand extends Command {

public static final String COMMAND_WORD = "fp";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all clients whose phone number begins with "
+ "the specified keywords (integers only with no spacing) and displays them as a list with index numbers.\n"
+ "Parameters: integers \n"
+ "Example: " + COMMAND_WORD + " 91234567";
public static final String MESSAGE_USAGE = FindCommand.COMMAND_WORD + " " + PREFIX_PHONE
+ " or " + COMMAND_WORD
+ ": Finds all clients whose phone number begins with "
+ "the specified PHONE_NUMBER and displays them as a list with index numbers.\n"
+ "Parameters: PHONE_NUMBER (Contains only 8 digits)\n"
+ "Example:\n"
+ "- " + COMMAND_WORD + " 91234567\n"
+ "- " + FindCommand.COMMAND_WORD + " " + PREFIX_PHONE + "91234567\n"
+ "Additional Info: \n"
+ "- PHONE_NUMBER is a sequence of integers with no spacing.";


private final PhoneBeginsWithKeywordPredicate predicate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
*/
public class AddCommandParser implements Parser<AddCommand> {

private static final String MESSAGE_MISSING_FIELD = "The following field is missing: %s";
private static final String MESSAGE_MULTIPLE_MISSING_FIELDS = "The following fields are missing: %s";
private static final String MESSAGE_MISSING_FIELD = "The following field for add command is missing: %s";
private static final String MESSAGE_MULTIPLE_MISSING_FIELDS =
"The following fields for add command are missing: %s";

// Map to store prefix to field description mapping
private static final HashMap<Prefix, String> FIELD_DESCRIPTIONS = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,40 +153,41 @@ public void parse_repeatedNonClientTypeValue_failure() {
@Test
public void parse_compulsoryFieldMissing_failure() {


// missing name prefix
assertParseFailure(parser, PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB + CLIENT_TYPE_DESC_A
+ DESCRIPTION_DESC_A + VALID_NAME_BOB,
"The following field is missing: n/NAME");
"The following field for add command is missing: n/NAME");

// missing phone prefix
assertParseFailure(parser, NAME_DESC_BOB + VALID_PHONE_BOB
+ EMAIL_DESC_BOB + ADDRESS_DESC_BOB + CLIENT_TYPE_DESC_A + DESCRIPTION_DESC_A,
"The following field is missing: p/PHONE");
"The following field for add command is missing: p/PHONE");

// missing email prefix
assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + VALID_EMAIL_BOB
+ ADDRESS_DESC_BOB + CLIENT_TYPE_DESC_A + DESCRIPTION_DESC_A,
"The following field is missing: e/EMAIL");
"The following field for add command is missing: e/EMAIL");

// missing address prefix
assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB
+ VALID_ADDRESS_BOB + CLIENT_TYPE_DESC_A + DESCRIPTION_DESC_A,
"The following field is missing: a/ADDRESS");
"The following field for add command is missing: a/ADDRESS");

// missing description prefix
assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB
+ ADDRESS_DESC_BOB + CLIENT_TYPE_DESC_A + VALID_DESCRIPTION_A,
"The following field is missing: d/DESCRIPTION");
"The following field for add command is missing: d/DESCRIPTION");

// missing client type prefix
assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB
+ ADDRESS_DESC_BOB + VALID_CLIENT_TYPE_A + DESCRIPTION_DESC_A,
"The following field is missing: c/CLIENT_TYPE");
"The following field for add command is missing: c/CLIENT_TYPE");

// all prefixes missing
assertParseFailure(parser, VALID_NAME_BOB + VALID_PHONE_BOB + VALID_EMAIL_BOB
+ VALID_ADDRESS_BOB + VALID_CLIENT_TYPE_A + VALID_DESCRIPTION_A,
"The following fields are missing: n/NAME a/ADDRESS p/PHONE "
"The following fields for add command are missing: n/NAME a/ADDRESS p/PHONE "
+ "e/EMAIL c/CLIENT_TYPE d/DESCRIPTION");
}

Expand Down