diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index 6496132247e..b95990d5bc3 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -30,7 +30,7 @@ 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 " @@ -38,10 +38,12 @@ public class AddCommand extends Command { + 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."; diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index ffaf7ae7e14..a12548a0c18 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -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"; diff --git a/src/main/java/seedu/address/logic/commands/FindAddressCommand.java b/src/main/java/seedu/address/logic/commands/FindAddressCommand.java index ea91cdf3d11..00267e27174 100644 --- a/src/main/java/seedu/address/logic/commands/FindAddressCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindAddressCommand.java @@ -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; @@ -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; diff --git a/src/main/java/seedu/address/logic/commands/FindClientTypeCommand.java b/src/main/java/seedu/address/logic/commands/FindClientTypeCommand.java index fc5959e8692..8bfb3d11450 100644 --- a/src/main/java/seedu/address/logic/commands/FindClientTypeCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindClientTypeCommand.java @@ -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; @@ -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; diff --git a/src/main/java/seedu/address/logic/commands/FindCommand.java b/src/main/java/seedu/address/logic/commands/FindCommand.java index f775c7ada40..b1724469193 100644 --- a/src/main/java/seedu/address/logic/commands/FindCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindCommand.java @@ -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; @@ -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; diff --git a/src/main/java/seedu/address/logic/commands/FindNameCommand.java b/src/main/java/seedu/address/logic/commands/FindNameCommand.java index 0a66ce0421d..14a6e0f0429 100644 --- a/src/main/java/seedu/address/logic/commands/FindNameCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindNameCommand.java @@ -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; @@ -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; diff --git a/src/main/java/seedu/address/logic/commands/FindPhoneCommand.java b/src/main/java/seedu/address/logic/commands/FindPhoneCommand.java index b2752609608..7dd1c126d3e 100644 --- a/src/main/java/seedu/address/logic/commands/FindPhoneCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindPhoneCommand.java @@ -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; @@ -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; diff --git a/src/main/java/seedu/address/logic/parser/AddCommandParser.java b/src/main/java/seedu/address/logic/parser/AddCommandParser.java index 7f56a243264..f2712f17288 100644 --- a/src/main/java/seedu/address/logic/parser/AddCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddCommandParser.java @@ -28,8 +28,9 @@ */ public class AddCommandParser implements Parser { - 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 FIELD_DESCRIPTIONS = new HashMap<>(); diff --git a/src/test/java/seedu/address/logic/parser/AddCommandParserTest.java b/src/test/java/seedu/address/logic/parser/AddCommandParserTest.java index 7065175d181..4fec4f49c5e 100644 --- a/src/test/java/seedu/address/logic/parser/AddCommandParserTest.java +++ b/src/test/java/seedu/address/logic/parser/AddCommandParserTest.java @@ -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"); }