From 174b92c984396024ca52b1b26ac46543cd42dd16 Mon Sep 17 00:00:00 2001 From: Ruth Lim <> Date: Thu, 19 Oct 2023 03:53:08 +0800 Subject: [PATCH] Standardise messages displayed to users --- src/main/java/seedu/address/logic/Messages.java | 3 ++- .../seedu/address/logic/commands/AddAppointmentCommand.java | 4 ++-- .../seedu/address/logic/commands/AddDentistCommand.java | 2 +- .../seedu/address/logic/commands/AddPatientCommand.java | 4 ++-- .../seedu/address/logic/commands/ListPatientCommand.java | 4 ++-- .../seedu/address/logic/commands/SearchDentistCommand.java | 4 ++-- .../seedu/address/logic/commands/SearchPatientCommand.java | 6 +++--- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/java/seedu/address/logic/Messages.java b/src/main/java/seedu/address/logic/Messages.java index f76ff9e21fe..8362ed9d16e 100644 --- a/src/main/java/seedu/address/logic/Messages.java +++ b/src/main/java/seedu/address/logic/Messages.java @@ -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 = diff --git a/src/main/java/seedu/address/logic/commands/AddAppointmentCommand.java b/src/main/java/seedu/address/logic/commands/AddAppointmentCommand.java index fedc58441bb..bb503958db2 100644 --- a/src/main/java/seedu/address/logic/commands/AddAppointmentCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddAppointmentCommand.java @@ -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; diff --git a/src/main/java/seedu/address/logic/commands/AddDentistCommand.java b/src/main/java/seedu/address/logic/commands/AddDentistCommand.java index 5bb6095905a..f44d59d0d66 100644 --- a/src/main/java/seedu/address/logic/commands/AddDentistCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddDentistCommand.java @@ -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; diff --git a/src/main/java/seedu/address/logic/commands/AddPatientCommand.java b/src/main/java/seedu/address/logic/commands/AddPatientCommand.java index 796c6acb804..e95207575ca 100644 --- a/src/main/java/seedu/address/logic/commands/AddPatientCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddPatientCommand.java @@ -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 " @@ -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); diff --git a/src/main/java/seedu/address/logic/commands/ListPatientCommand.java b/src/main/java/seedu/address/logic/commands/ListPatientCommand.java index d0982c7b0ea..f5b97446ced 100644 --- a/src/main/java/seedu/address/logic/commands/ListPatientCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListPatientCommand.java @@ -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 diff --git a/src/main/java/seedu/address/logic/commands/SearchDentistCommand.java b/src/main/java/seedu/address/logic/commands/SearchDentistCommand.java index b9e32ef51d9..137e2eb3bc5 100644 --- a/src/main/java/seedu/address/logic/commands/SearchDentistCommand.java +++ b/src/main/java/seedu/address/logic/commands/SearchDentistCommand.java @@ -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) { @@ -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."); } diff --git a/src/main/java/seedu/address/logic/commands/SearchPatientCommand.java b/src/main/java/seedu/address/logic/commands/SearchPatientCommand.java index 6aef6b38717..0ed7883191d 100644 --- a/src/main/java/seedu/address/logic/commands/SearchPatientCommand.java +++ b/src/main/java/seedu/address/logic/commands/SearchPatientCommand.java @@ -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"; @@ -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) { @@ -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."); }