Skip to content

Commit

Permalink
Merge pull request AY2324S2-CS2103T-T08-1#130 from alex-setyawan/mess…
Browse files Browse the repository at this point in the history
…ages

Adjusted Messages
  • Loading branch information
jovantanyk authored Apr 4, 2024
2 parents aa103d9 + ec49d60 commit 77df05b
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class AddVisitCommand extends Command {
public static final String COMMAND_WORD = "addvisit";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a visit to a patient."
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\nAdds a visit to a patient."
+ "\nParameters: "
+ PREFIX_NRIC + "NRIC "
+ PREFIX_DATEOFVISIT + "DATEOFVISIT "
Expand All @@ -31,7 +31,7 @@ public class AddVisitCommand extends Command {
+ PREFIX_DATEOFVISIT + "2024-01-04 "
+ PREFIX_SYMPTOM + "Fever, Rhinorrhea "
+ PREFIX_DIAGNOSIS + "Common Flu "
+ PREFIX_STATUS + "PENDING ";
+ PREFIX_STATUS + "PENDING";

public static final String MESSAGE_SUCCESS = "New Visit added: %1$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This visit already exists in the system";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/logic/commands/CheckCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class CheckCommand extends Command {

public static final String COMMAND_WORD = "check";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Checks the visits in history of the person identified "
+ "by the NRIC specified. "
+ "Example: " + COMMAND_WORD
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\nChecks the visits in history of the person identified"
+ " by the NRIC specified. "
+ "\nExample: " + COMMAND_WORD
+ " S0123456A";

public static final String MESSAGE_READ_PERSON_SUCCESS = "Checked Person ->\n%1$s";
Expand Down
23 changes: 9 additions & 14 deletions src/main/java/seedu/address/logic/commands/ClusterCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

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

import seedu.address.commons.util.ToStringBuilder;
import seedu.address.logic.commands.exceptions.CommandException;
Expand All @@ -20,18 +17,16 @@ public class ClusterCommand extends Command {

public static final String COMMAND_WORD = "cluster";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Updates the details of the person identified "
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\nDetects if there is a cluster of the size given,"
+ " at the location given, of the disease given, and shows the details of all there with the disease."
+ "by the respective NRIC in the displayed person list. "
+ "Existing values will be overwritten by the input values.\n"
+ "Parameters: NRIC "
+ "[" + PREFIX_NAME + "NAME] "
+ "[" + PREFIX_PHONE + "PHONE] "
+ "[" + PREFIX_EMAIL + "EMAIL] "
+ "[" + PREFIX_ADDRESS + "ADDRESS] "
+ "[" + PREFIX_TAG + "TAG]...\n"
+ "Example: " + COMMAND_WORD + " S0123456A "
+ PREFIX_PHONE + "91234567 "
+ PREFIX_EMAIL + "johndoe@example.com";
+ "Parameters: [CLUSTER SIZE] "
+ "[" + PREFIX_ADDRESS + "LOCATION] "
+ "[" + PREFIX_DIAGNOSIS + "DISEASE]\n"
+ "Example: " + COMMAND_WORD + " 50 "
+ PREFIX_ADDRESS + "choa chu kang "
+ PREFIX_DIAGNOSIS + "dengue";

public static final String MESSAGE_NO_INFECTED_PEOPLE = "Good news! This area \"%1$s\" has no patients with %2$s.";
public static final String MESSAGE_CLUSTER_FOUND_SUCCESS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class CreateCommand extends Command {
public static final String COMMAND_WORD = "create";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Creates a person in Immunimate. "
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\nCreates a person in Immunimate. "
+ "\nParameters: "
+ PREFIX_NRIC + "NRIC "
+ PREFIX_NAME + "NAME "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DeleteCommand extends Command {
public static final String COMMAND_WORD = "delete";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the person identified by the NRIC.\n"
+ ":\nDeletes the person identified by the NRIC.\n"
+ "Parameters: NRIC\n"
+ "Example: " + COMMAND_WORD + " S0123456A";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class DeleteInfoCommand extends Command {
public static final String COMMAND_WORD = "deleteinfo";

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the information of the person identified by NRIC.\n"
+ ":\nDeletes the information of the person identified by NRIC.\n"
+ "Parameters: NRIC, fields to be deleted\n"
+ "Example: " + COMMAND_WORD + " S1234567B" + PREFIX_EMAIL;
public static final String MESSAGE_ONLY_OPTIONAL_FIELDS = "Only optional fields can be deleted.";
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/seedu/address/logic/commands/FindCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public class FindCommand extends Command {

public static final String COMMAND_WORD = "find";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all persons whose names, addresses or conditions"
+ " contain any of "
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\nFinds all persons"
+ " whose names, addresses or conditions contain any of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\n"
+ "Example (name): " + COMMAND_WORD + " " + PREFIX_NAME + " alice bob charlie"
+ "\nExample (address): " + COMMAND_WORD + " " + PREFIX_ADDRESS + " tampines street, geylang road"
+ "\nExample (condition): " + COMMAND_WORD + " " + PREFIX_CONDITION + " diabetes, high blood pressure";
+ "Example (name): " + COMMAND_WORD + " " + PREFIX_NAME + "alice bob charlie"
+ "\nExample (address): " + COMMAND_WORD + " " + PREFIX_ADDRESS + "tampines street, geylang road"
+ "\nExample (condition): " + COMMAND_WORD + " " + PREFIX_CONDITION + "diabetes, high blood pressure";

private final Predicate<Person> predicate;
//TODO: add nric contains keywords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class HelpCommand extends Command {

public static final String COMMAND_WORD = "help";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Shows program usage instructions.\n"
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\nShows program usage instructions.\n"
+ "Example: " + COMMAND_WORD;

public static final String SHOWING_HELP_MESSAGE = "Opened help window.";
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/seedu/address/logic/commands/ReadCommand.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package seedu.address.logic.commands;

import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NRIC;
import static seedu.address.model.Model.PREDICATE_SHOW_ALL_PERSONS;

import seedu.address.commons.util.ToStringBuilder;
Expand All @@ -19,12 +18,11 @@ public class ReadCommand extends Command {

public static final String COMMAND_WORD = "read";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Reads the details of the person identified "
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\nReads the details of the person identified "
+ "by the NRIC specified. "
+ "\nParameters: "
+ PREFIX_NRIC + "NRIC "
+ "\nParameters: NRIC"
+ "\nExample: " + COMMAND_WORD
+ PREFIX_NRIC + "S0123456A";
+ " S0123456A";

public static final String MESSAGE_READ_PERSON_SUCCESS = "Read Person ->\n%1$s";
private final Nric nric;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/seedu/address/logic/commands/UpdateCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public class UpdateCommand extends Command {

public static final String COMMAND_WORD = "update";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Updates the details of the person identified "
public static final String MESSAGE_USAGE = COMMAND_WORD + ":\nUpdates the details of the person identified "
+ "by the respective NRIC in the displayed person list. "
+ "Existing values will be overwritten by the input values.\n"
+ "Parameters: NRIC "
+ "\nExisting values will be overwritten by the input values."
+ "\nParameters: NRIC "
+ "[" + PREFIX_NAME + "NAME] "
+ "[" + PREFIX_PHONE + "PHONE] "
+ "[" + PREFIX_ADDRESS + "ADDRESS] "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ public FindCommand parse(String args) throws ParseException {
return new FindCommand(new NameContainsKeywordsPredicate(list));
} else if (trimmedArgs.startsWith(PREFIX_ADDRESS.getPrefix())) {
String[] addressKeywords = trimmedArgs.substring(2).trim().split(",");
int len = addressKeywords.length;
for (int i = 0; i < len; i++) {
addressKeywords[i] = addressKeywords[i].trim();
}
List<String> list = Arrays.asList(addressKeywords);
return new FindCommand(new AddressContainsKeywordsPredicate(list));
} else if (trimmedArgs.startsWith(PREFIX_CONDITION.getPrefix())) {
String[] conditionKeywords = trimmedArgs.substring(4).trim().split(",");
int len = conditionKeywords.length;
for (int i = 0; i < len; i++) {
conditionKeywords[i] = conditionKeywords[i].trim();
}
List<String> list = Arrays.asList(conditionKeywords);
return new FindCommand(new ConditionContainsKeywordsPredicate(list));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ public Command parseCommand(String userInput) throws ParseException {

case DeleteCommand.COMMAND_WORD:
return new DeleteCommandParser().parse(arguments);

case DeleteInfoCommand.COMMAND_WORD:
return new DeleteInfoCommandParser().parse(arguments);

case ExitCommand.COMMAND_WORD:
return new ExitCommand();

Expand Down

0 comments on commit 77df05b

Please sign in to comment.