Skip to content

Commit

Permalink
Merge pull request #79 from ruth-lim/master
Browse files Browse the repository at this point in the history
Standardise messages displayed to users
  • Loading branch information
SynapseProgramming authored Oct 19, 2023
2 parents 6d7e7ff + 174b92c commit 1d0dde7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public class Messages {
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_PERSON_DISPLAYED_INDEX = "The person index provided is invalid";
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d dentists listed!";
public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!";
public static final String MESSAGE_DENTISTS_LISTED_OVERVIEW = "%1$d dentists listed!";
public static final String MESSAGE_INVALID_PATIENT_DISPLAYED_INDEX = "The patient index provided is invalid";
public static final String MESSAGE_PATIENTS_LISTED_OVERVIEW = "%1$d patients listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class AddAppointmentCommand extends Command {
+ PREFIX_DURATION + "PT1H30M "
+ PREFIX_SERVICE + "Braces";

public static final String MESSAGE_SUCCESS = "New Appointment added: %1$s";
public static final String MESSAGE_SUCCESS = "New Appointment added: 1$s%";

public static final String MESSAGE_CLASHING_APPOINTMENTS = "This Appointment clashes with a current one";
public static final String MESSAGE_CLASHING_APPOINTMENTS = "This Appointment clashes with a current one.";

private final Appointment toAdd;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AddDentistCommand extends Command {
+ PREFIX_YOE + "5 "
+ PREFIX_TAG + "Braces";

private static final String MESSAGE_SUCCESS = "New dentist added: %1$s";
private static final String MESSAGE_SUCCESS = "New Dentist added: %1$s";
private static final String MESSAGE_DUPLICATE_DENTIST = "This dentist already exists in ToothTracker address book!";

private final Dentist toAdd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class AddPatientCommand extends Command {
public static final String COMMAND_WORD = "add-patient";

public static final String MESSAGE_USAGE =
COMMAND_WORD + ": Adds a person to the address book. "
COMMAND_WORD + ": Adds a patient to the address book. "
+ "Parameters: "
+ PREFIX_NAME + "NAME "
+ PREFIX_PHONE + "PHONE "
Expand Down Expand Up @@ -53,7 +53,7 @@ public class AddPatientCommand extends Command {
private final Patient toAdd;

/**
* Creates an AddCommand to add the specified {@code Person}
* Creates an AddPatientCommand to add the specified {@code Patient}
*/
public AddPatientCommand(Patient patient) {
requireNonNull(patient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import seedu.address.model.Model;

/**
* Lists all persons in the address book to the user.
* Lists all patients in the address book to the user.
*/
public class ListPatientCommand extends Command {

public static final String COMMAND_WORD = "list-patients";

public static final String MESSAGE_SUCCESS = "Listed all patients";
public static final String MESSAGE_SUCCESS = "Listed all patients!";


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public CommandResult execute(Model model) {

model.updateFilteredDentistList(predicate);
return new CommandResult(
String.format(Messages.MESSAGE_PERSONS_LISTED_OVERVIEW, model.getFilteredDentistList().size()));
String.format(Messages.MESSAGE_DENTISTS_LISTED_OVERVIEW, model.getFilteredDentistList().size()));

} else if (searchType == SearchType.BY_ID) {

Expand All @@ -81,7 +81,7 @@ public CommandResult execute(Model model) {
model.updateFilteredDentistList(dentistIdPredicate);

if (model.getFilteredDentistList().isEmpty()) {
return new CommandResult("No dentist found with dentist ID " + dentistID);
return new CommandResult("No dentist found with dentist ID " + dentistID + ".");
} else {
return new CommandResult("Dentist with dentist ID " + dentistID + " found.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SearchPatientCommand extends Command {
public static final String COMMAND_WORD = "search-patient";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all patients whose names contain any of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "the specified keywords (case-insensitive) and displays them as a list.\n"
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\n"
+ "Example: " + COMMAND_WORD + " John Tan";

Expand Down Expand Up @@ -70,7 +70,7 @@ public CommandResult execute(Model model) {

model.updateFilteredPatientList(predicate);
return new CommandResult(
String.format(Messages.MESSAGE_PERSONS_LISTED_OVERVIEW, model.getFilteredPatientList().size()));
String.format(Messages.MESSAGE_PATIENTS_LISTED_OVERVIEW, model.getFilteredPatientList().size()));

} else if (searchType == SearchPatientCommand.SearchType.BY_ID) {

Expand All @@ -79,7 +79,7 @@ public CommandResult execute(Model model) {
model.updateFilteredPatientList(patientIdPredicate);

if (model.getFilteredPatientList().isEmpty()) {
return new CommandResult("No patient found with patient ID " + patientID);
return new CommandResult("No patient found with patient ID " + patientID + ".");
} else {
return new CommandResult("Patient with patient ID " + patientID + " found.");
}
Expand Down

0 comments on commit 1d0dde7

Please sign in to comment.