diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md
index 698faef8fa1..8982943b26c 100644
--- a/docs/DeveloperGuide.md
+++ b/docs/DeveloperGuide.md
@@ -9,7 +9,22 @@ title: Developer Guide
## **Acknowledgements**
-* {list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}
+### Dong Cheng-Yu's Acknowledgements
+- Used ChatGPT to assist in writing Javadocs for AddDoctorCommandParser, AddDoctorCommand, and DeleteAppointmentCommandParser.
+
+### Lu Zhiyang's Acknowledgements
+- Used ChatGPT to assist in writing Javadocs for AddPatientCommandParser, AddPatientCommand, EditAppointmentCommandParser, EditAppointmentCommand.
+
+### Lim Jia Wei's Acknowledgements
+- Used ChatGPT to assist in writing Javadocs for QueryDoctorAppointmentCommand, QueryPatientAppointmentCommand, QueryDoctorAppointmentCommandParser, QueryPatientAppointmentCommandParser, QueryPatientCommand and QueryPatientCommandParser.
+- Used ChatGPT to assist in writing parts of User Guide and Developer Guide and test code.
+
+### Sim Eugene's Acknowledgements
+- Used ChatGPT to assist in writing Javadocs for
+ EditCommand, EditCommandParser and QueryDoctorCommand
+
+### Goswami Archit's Acknowledgements
+- Used ChatGPT to assist in writing Javadocs for getPersonByNric(), addAppointment(), hasAppointment(), deleteAppointment() methods, and to write some javafx code
--------------------------------------------------------------------------------------------------------------------
@@ -36,7 +51,7 @@ Given below is a quick overview of main components and how they interact with ea
**Main components of the architecture**
-**`Main`** (consisting of classes [`Main`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/Main.java) and [`MainApp`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java)) is in charge of the app launch and shut down.
+**`Main`** (consisting of classes [`Main`](https://github.com/AY2324S2-CS2103T-T15-1/tp/blob/master/src/main/java/seedu/address/Main.java) and [`MainApp`](https://github.com/AY2324S2-CS2103T-T15-1/tp/blob/master/src/main/java/seedu/address/MainApp.java)) is in charge of the app launch and shut down.
* At app launch, it initializes the other components in the correct sequence, and connects them up with each other.
* At shut down, it shuts down the other components and invokes cleanup methods where necessary.
@@ -68,7 +83,7 @@ The sections below give more details of each component.
### UI component
-The **API** of this component is specified in [`Ui.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/Ui.java)
+The **API** of this component is specified in [`Ui.java`](https://github.com/AY2324S2-CS2103T-T15-1/tp/blob/master/src/main/java/seedu/address/ui/Ui.java)

@@ -149,7 +164,7 @@ This section describes some noteworthy details on how certain features are imple
The section is structured as follows:
- We first dive into the implementation of the `Appointment` - a special entity type that MediCLI tracks.
-- We then explore what happens when the `execute` method of different types of `commands` is called.
+- We then explore what happens when the `execute` method of different types of `Commands` is called.
- Finally, we look at how MediCLI deals with incorrect user inputs for operations on both `Persons` and `Appointments`
Through this, we hope to give you a thorough overview of how MediCLI's main features are implemented.
@@ -165,7 +180,7 @@ As visible, the `Appointment` class contains references to the following classes
- **`Nric`**: a doctor's & a patient's NRIC number
- **`AppointmentDateTime`**: Date and time of the appointment
-The appointment class must have reference to exactly 2 `Nric` classes and 1 `AppointmentDateTime` and `AppointmentId`
+The appointment class must have reference to exactly 2 `Nric` objects and 1 `AppointmentDateTime` object.
Below is an object diagram demonstrating a possible appointment object.
@@ -202,111 +217,73 @@ Implementing `Appointments` naturally involved many design decisions, and here w
* Eg: the class in question would have to change from `Person` to `Entry` in a number of different places.
### Understanding how MediCLI executes different types of commands
-
-
-### Incorrect user input handling process
-In this section, we will use the _add_ commands for `patients`/`doctors` and `appointments` to demonstrate how MediCLI handles incorrect inputs from the user.
-
-#### Incorrect input handling process for commands that involve operations on the `Person` class
-The activity diagram below demonstrates this incorrect input handling process of a command that operates on the `Person` class.
-Specifically, we look at the process of adding a `Person` to MediCLI i.e. `addpatient` or `adddoctor` commands, potential mistakes that the user might make, and how they are handled by MediCLI.
-
-
-
-As visible, an incorrect input by the user can result in the following types of errors depending on the type of mistake:
-- **Command word is incorrect**: informs the user that command word is unowkown.
-- **Missing required field arguments**: informs the user of invalid command format.
-- **Invalid field arguments**: highlights to the user that invalid field arguments were provided.
-- **`Patient`/`Doctor` with corresponding attributes already exists in the system**: informs the user that `Patient`/`Doctor` already exists in the system.
-
-
-#### Incorrect user input handling process for the `Appointment` class
-The activity diagram below demonstrates this incorrect input handling process of a command that operates on the `Appointment` class.
-Specifically, we look at the process of adding an `Appointment` to MediCLI i.e. `addappt` command, potential mistakes that the user might make, and how they are handled by MediCLI.
-
-
-
-As visible, an incorrect input by the user can result in the following types of errors depending on the type of mistake:
-- **Command word is incorrect**: informs the user that command word is unowkown
-- **Missing required field arguments**: informs the user of invalid command format
-- **Invalid field arguments**: highlights to the user that invalid field arguments were provided
-- **`Patient`/`Doctor` involved in the `Appointment` does not exist in MediCLI**: informs the user that `Patient`/`Doctor` involved are not registered
-- **Provided date & time of the `Appointment` is in the past**: informs the user that appointments cannot be scheduled in the past.
-- **`Appointment` with corresponding attributes already exists in MediCLI**: informs the user that `Appointment` already exists
-
-
+MediCLI currently supports four main types of functionality, namely: add, edit, query, and delete. Each of these functionalities are supported for both people (patient & doctor) and appointments through different command words.
+However, different commands of the same functionality are analougous to each other to enhance readablity and expandability.
+Furthermore, all of the commands extend the main `Command` class, thus the primary difference between each of them is within their `execute` methods. For their general implementation, please refer the "Logic component" section above.
+This section will explore the implemention of the `execute` methods for each of the four functionalities.
-### Add a `Patient` or `Doctor`
+#### Add Functionality
Note: Add `patient` and `doctor` has been grouped together as they are very similar in implementation.
This reduces repetition of information and increases clarity.
Adds a new `Patient` or `Doctor` entry by indicating their `NRIC`, `Name`, `DoB`, and `Phone`.
This command is implemented through the `AddPatientCommand` for patient and `AddDoctorCommand` for doctor class which both extend the `Command` class.
-The activity diagram below demonstrates the error handling process in more detail.
-
-
-
-The sequence diagram below demonstrates the command execution steps for `execute` method in `AddpatientCommand`.
-
-
-
-This is the sequence of command execution for `execute` in `AddPatientCommand`, however `AddDoctorCommand` and `AddAppointmentCommand` follow similar design patterns within the execute command.
Add command execution sequence:
* Step 1. The `execute` method of the `AddPatientCommand` is called.
* Step 2. The method calls the `hasPerson` method of `Model` to check if there are any duplicate patients.
- * If there is a duplicate person, the method throws `CommandException` and calls the `log` method of `logger` to log the incident.
+ * If there is a duplicate person, the method throws `CommandException` and calls the `log` method of `logger` to log the incident.
* Step 3. The `addPerson` method of `Model` is then called and the control is passed back to the `execute` method.
* Step 4. The `log` method of `logger` is then called to log the successful command execution.
* Step 5. A new `CommandResult` object with the success message is then created and returned by `execute`.
-#### Design considerations:
-
-**Aspect: How editing a Person works:**
-
-* **Alternative 1 (current choice):** Removes the `originalPerson` and adds the `editedPerson`.
- * Pros: Retains the sorted order of Persons by `Name` in the person list.
- * Cons: May have performance issues in terms of time complexity since it requires 2 operations (`deletePerson()` and `addPerson`).
-
-* **Alternative 2:** Directly update the fields in the `originalPerson`
- * Pros: Better performance, since this only requires searching through the person list once.
- * Cons: The order of person list will be lost, since `Name` of a `Person` may be edited.
-
+This is the sequence of command execution for `execute` in `AddPatientCommand`, however `AddDoctorCommand` and `AddAppointmentCommand` follow similar design patterns within the execute command.
+
-### Edit `doctor` or `patient`
+#### Edit Functionality
Edits a `doctor` or `patient` entry by indicating their `Index`.
This command is implemented through the `EditCommand` class which extends the `Command` class.
-The activity diagram below demonstrates the error handling process in more detail.
-
-
-
-The sequence diagram below demonstrates the command execution steps for `execute` method in `EditCommand`.
-
-
-
This is the sequence of command execution for `execute` in `EditCommand`, however `EditAppointmentCommand` follow a similar design pattern within the `execute` command.
* Step 1. The `execute` method of the `EditCommand` is called.
* Step 2. The method calls the `getFilteredPersonList` method of `Model` and returns the list.
* Step 3. The command checks whether the index of the command is valid by comparing the value returned by the `getZeroBased` method of `index` to the size of the list.
- * If the index is invalid, the command throws `CommandException`.
+ * If the index is invalid, the command throws `CommandException`.
* Step 4. The `createEditedPerson` method is called and returns a new edited person.
* Step 5. The method calls the `hasPerson` method of `Model` to check if there are any duplicate persons.
- * If there are duplicates, the command throws `CommandException`.
+ * If there are duplicates, the command throws `CommandException`.
* Step 6. The `setPerson` method of `Model` is called and control is then passed back to the `execute` method.
* Step 7. The `updateFilteredPersonList` method of `Model` is called to update the list.
* Step 8. A new `CommandResult` with the success message is then created and returned by `execute`.
+The sequence diagram below demonstrates the command execution steps for `execute` method in `EditCommand`.
+
+
+
+#### Querying Functionality
+This section describes the general sequence for commands that query entities. MediCLI has 5 different commands that serve this function: `find`, `patient`, `doctor`, `apptforpatient` and `apptfordoctor`.
+Although this section describes only the `patient` command, each of the other commands, while lined with different predicates and have different requirements for their parameters, possesses similar implementation. Hence, the flow of method calls between classes are generally similar, and all 5 commands that query entities are described here together in one section.
+
+* Step 1. The `execute()` method is called in an instance of `QueryPatientCommand`.
+* Step 2. The instance of `QueryPatientCommand` calls the `updateFilteredPersonList()` method with the `PatientContainsKeywordsPredicate` in an instance of the `Model` class, which filters out entries and returns only patients that match the keywords entered. Note that the other commands listed here will have their respective `predicate` requirements and implementations.
+* Step 3. Control is passed to an instance of the `Logger` class, which calls the method `log()` to log a "Success" message.
+* Step 4. The instance of `QueryPatientCommand` calls the constructor method of the `CommandResult` class, which returns the final result.
+* Step 5. Control is returned to the caller with the final result.
+
+The sequence diagram below describes the interaction between the various components during the `execute` method of the `patient` command, which uses the `QueryPatientCommand` on the backend.
+
+
+
Why is this implemented this way?
-1. Making both `Doctor` and `Patient` class extend the `Person` class makes it easier to execute edit operations.
-2. `Doctor` and `Patient` all exhibit similar qualities, and thus can inherit from the `Person` superclass.
-3. Eliminates the need for separate edit commands for doctor and patient.
-4. Since appointments are constructed with unique `Person` `Nric` fields, it does not make sense to have an appointment that does not have valid or outdated doctor or patient entries.
-5. As such, the solution that is inbuilt to editing a `Person`, comes with the added functionality on the backend to augment all related `Appointment` entries as well.
-6. This results in an updated `Appointments` panel, and saves the user from the hassle of needing to manually edit outdated `Appointment` entries one by one.
+1. All query command closely resembles the structure of the `find` command. Each of the commands here have either stricter (i.e have stricter parameter requirements e.g `apptforpatient` and `apptfordoctor`) or looser (i.e searching for more fields e.g `patient` and `doctor`) predicates, but all generally have the same flow of control between the `Command`, `Logger` and `Model` classes.
+2. Conceptually, each of the 5 commands listed here are searching for different entities, and are hence split into separate commands despite having very similar structures.
-### Delete `doctor` or `patient`
+Alternative implementations considered
+1. The behaviour of `patient` and `doctor`, `apptforpatient` and `apptfordoctor` have similar requirements in terms of parameters, with the main difference being either `patient` or `doctor` typed classes. We might consider combining each pair into one command, and using flags to distinguish the desired class (e.g a -doctor or -patient flag to indicate we wish to search for only `doctor` and `patient` entries respectively) so as to avoid the need to create additional commands. However, we felt that at the time of implementation, separating the commands would be a cleaner strategy, and combining methods might overcomplicate the implementation.
+2. Even if we did proceed with combining, the combined command was to be overloaded with flags, we foresaw that the creation of distinct commands to fit the flags parsed were unavoidable. As such, it was prudent to start with the implementation of the distinct commands first, and leave the possibility of combining as a later increment.
+
+#### Delete Functionality
Deletes a `doctor` or `patient` entry by indicating their `Index`.
This command is implemented through the `DeleteCommand` class which extends the `Command` class.
@@ -315,7 +292,7 @@ This command is implemented through the `DeleteCommand` class which extends the
* Step 2. The `getFilteredPersonList` method of `Model` is called and finds its length.
* Step 3. The `getZeroBased` method of `Index` is called to convert the provided index to its zero-based equivalent.
* Step 4. The provided index is checked against the length of the current list of people.
- * If the provided index is out of bounds, a `CommandException` is thrown.
+ * If the provided index is out of bounds, a `CommandException` is thrown.
* Step 4. The `deletePerson` method of `Model` is called to remove the designated person from the list of people.
* Step 5. An instance of `CommandResult` is created with a success message for the execution of `DeleteCommand`.
* Step 6. The instance of `CommandResult` is returned.
@@ -324,131 +301,35 @@ The sequence diagram below closely describes the interaction between the various
+### Incorrect user input handling process
+In this section, we will use the _add_ commands for `patients`/`doctors` and `appointments` to demonstrate how MediCLI handles incorrect inputs from the user.
-Why is this implemented this way?
-1. Making both `Doctor` and `Patient` class extend the `Person` class makes it easier to execute delete operations.
-2. `Doctor` and `Patient` all exhibit similar qualities, and thus can inherit from the `Person` superclass.
-3. Eliminates the need for separate delete commands for doctor and patient.
-4. Since appointments are constructed with unique `Person` `Nric` fields, it does not make sense to have an appointment that does not have valid doctor or patient entries.
-5. As such, the solution that is inbuilt to deleting a `Person`, comes with the added functionality on the backend to delete all related `Appointment` entries as well.
-6. This results in a cleaner `Appointments` panel, and saves the user from the hassle of needing to delete unwanted `Appointment` entries one by one.
-
-
-### Add a `Appointment`
-
-Adds a new `Appointment` entry by indicating the `patientNric`, `doctorNric`, and an `appointmentDateTime`.
-The values stored in each of these attributes are self-explanatory. A key thing to note is that a `Patients` /`Doctor` with the NRIC number must already exist in the records, and the date & time must be in the future.
-
-This command is implemented through the `AddAppointmentCommand` class which extend the `Command` class.
-
-* Step 1. User enters the keyword and attributes necessary for adding an appointment as indicated above.
-* Step 2. The `AddressBookParser` will call `parseCommand` on the user's input string and return an instance of `addAppointmentCommandParser`.
-* Step 3. The `parse` command in `addPatientCommandParser` calls `ParserUtil` to create instances of objects for each of the fields.
- * If there are any missing fields, a `CommandException` is thrown.
- * If input arguments does not match constraints for the fields, a `IllegalArgumentException` is thrown.
-* Step 4. The `parse` command in `addAppointmentCommandParser` return an instance of `addAppointmentCommand`.
-* Step 5. The `LogicManager` calls the `execute` method in `addAppointmentCommand`.
-* Step 6. The `execute` method in `addAppointmentCommand` performs the following checks:
- * If a `Doctor`/`Patient` with the Nric in question not exist or the date & time is not >= current date & time, a `InvalidAppointmentException` is thrown
- * If an appointment between the `Doctor` and `Patient` (with corresponding NRICs) on the specified date & time already exists, then a `DuplicateAppointmentException` is thrown.
-* Step 7: If both the checks above pass, the `execute` method executes and calls `addAppointment` in model to add the new appointment into the system.
-* Step 8: Success message gets printed onto the results display to notify user.
-
-The activity diagram below demonstrates this error handling process in more detail.
-
-
-### Edit `Appointment`
-Edits an `Appointment` entry by indicating their `Index`.
-This command is implemented through the `EditAppointmentCommand` class which extends the `Command` class.
-
-* Step 1. User enters an `edi`tappt` command.
-* Step 2. The `AddressBookParser` will call `parseCommand` on the user's input string and return an instance of `editAppointmentCommandParser`.
-* Step 3. The `parse` command in `editAppointmentCommandParser` calls `ParserUtil` to create instances of objects for each of the fields.
- * If there are any missing fields, a `CommandException` is thrown.
- * If input arguments does not match contraints for the fields, a `IllegalArgumentException` is thrown.
- * If the provided `index` is invalid, a `CommandException` is thrown.
-
-The activity diagram below demonstrates this error handling process in more detail.
-
-
-
-* Step 4. The `parse` command in `editAppointmentCommandParser` returns an instance of `editAppointmentCommand`.
-* Step 5. The `LogicManager` calls the `execute` method in `editAppointmentCommand`.
-* Step 6. The `execute` method in `editAppointmentCommand` executes and calls `setAppointment` in model to set an updated appointment into the system.
-* Step 7. Success message gets printed onto the results display to notify user.
-
-The sequence diagram below closely describes the interaction between the various components during the execution of the `EditAppointmentCommand`.
-
-
-
-Why is this implemented this way?
-1. The `Appointment` class has very similar functionalities to that of the `Person` class, in which both classes deal with edit operations.
-2. Furthermore on the UI, the `Appointment` column runs parallel to the `Person` column, as such, the behaviours (UX) of operating on the `Person` panel should have a similar feel and experience when dealing with `Appointment` objects.
-3. This parallelism is also reflected in the backend code, and hence is very similar to how editing a `Person` is implemented - this is mostly seen through the naming conventions of the classes related to `EditPerson`, such as `EditAppointment`
-4. This results in a more familiar experience for both users and developers alike as there is familiarity and some level of consistency when dealing with `Person` and `Appointment` classes.
-
-Alternative implementation for consideration
-1. Since both classes exhibit similarities in both code structure and behaviour, we might consider creating a generic class distinguished between `Person` and `Appointment` via enums to handle edits.
-2. This will centralise the behaviours, and reduce the amount of code needed to perform the edit function.
-3. A further extension is to do so with all other overlapping functionalities, such as `add` or `delete`, however we leave that possibility for future discussion and refinement.
-
-### Delete `Appointment`
-Deletes an `Appointment` entry by indicating their `Index`.
-This command is implemented through the `DeleteAppointmentCommand` class which extend the `Command` class.
-
-* Step 1. User enters an `deleteappt` command.
-* Step 2. The `AddressBookParser` will call `parseCommand` on the user's input string and return an instance of `deleteAppointmentCommandParser`.
-* Step 3. The `parse` command in `deleteAppointmentCommandParser` calls `ParserUtil` to create instances of objects for each of the fields.
- * If there are any missing fields, a `CommandException` is thrown.
- * If input arguments does not match contraints for the fields, a `IllegalArgumentException` is thrown.
- * If the provided `index` is invalid, a `CommandException` is thrown.
-
-The activity diagram below demonstrates this error handling process in more detail.
-
-
-
-* Step 4. The `parse` command in `deleteAppointmentCommandParser` return an instance of `deleteAppointmentCommand`.
-* Step 5. The `LogicManager` calls the `execute` method in `deleteAppointmentCommand`.
-* Step 6. The `execute` method in `deleteAppointmentCommand` executes and calls `deleteAppointment` in model to remove appointment from the system.
-* Step 7. Success message gets printed onto the results display to notify user.
-
-The sequence diagram below closely describes the interaction between the various components during the execution of the `DeleteAppointmentCommand`.
-
-
-
-Why is this implemented this way?
-1. The `Appointment` class has very similar functionalities to that of the `Person` class, in which both classes deal with deletion operations.
-2. Furthermore on the UI, the `Appointment` column runs parallel to the `Person` column, as such, the behaviours (UX) of operating on the `Person` panel should have a similar feel and experience when dealing with `Appointment` objects.
-3. This parallelism is also reflected in the backend code, and hence is very similar to how deleting a `Person` is implemented - this is mostly seen through the naming conventions of the classes related to `DeletePerson`, such as `DeleteAppointment`
-4. This results in a more familiar experience for both users and developers alike as there is familiarity and some level of consistency when dealing with `Person` and `Appointment` classes.
-
-Alternative implementation for consideration
-1. Since both classes exhibit similarities in both code structure and behaviour, we might consider creating a generic class distinguished between `Person` and `Appointment` via enums to handle deletions.
-2. This will centralise the behaviours, and reduce the amount of code needed to perform the delete function.
-3. A further extension is to do so with all other overlapping functionalities, such as `add` or `edit`, however we leave that possibility for future discussion and refinement.
-
-### Querying Entities in MediCLI `patient`, `doctor`, `appointment`
-This section describes the general sequence for commands that query entities. MediCLI has 5 different commands that serve this function: `find`, `patient`, `doctor`, `apptforpatient` and `apptfordoctor`.
-Although this section describes only the `patient` command, each of the other commands, while lined with different predicates and have different requirements for their parameters, possesses similar implementation. Hence, the flow of method calls between classes are generally similar, and all 5 commands that query entities are described here together in one section.
+#### Incorrect input handling process for commands that involve operations on the `Person` class
+The activity diagram below demonstrates this incorrect input handling process of a command that operates on the `Person` class.
+Specifically, we look at the process of adding a `Person` to MediCLI i.e. `addpatient` or `adddoctor` commands, potential mistakes that the user might make, and how they are handled by MediCLI.
-* Step 1. The `execute()` method is called in an instance of `QueryPatientCommand`.
-* Step 2. The instance of `QueryPatientCommand` calls the `updateFilteredPersonList()` method with the `PatientContainsKeywordsPredicate` in an instance of the `Model` class, which filters out entries and returns only patients that match the keywords entered. Note that the other commands listed here will have their respective `predicate` requirements and implementations.
-* Step 3. Control is passed to an instance of the `Logger` class, which calls the method `log()` to log a "Success" message.
-* Step 4. The instance of `QueryPatientCommand` calls the constructor method of the `CommandResult` class, which returns the final result.
-* Step 5. Control is returned to the caller with the final result.
+
-The sequence diagram below describes the interaction between the various components during the `execute` method of the `patient` command, which uses the `QueryPatientCommand` on the backend.
+As visible, an incorrect input by the user can result in the following types of errors depending on the type of mistake:
+- **Command word is incorrect**: informs the user that command word is unowkown.
+- **Missing required field arguments**: informs the user of invalid command format.
+- **Invalid field arguments**: highlights to the user that invalid field arguments were provided.
+- **`Patient`/`Doctor` with corresponding attributes already exists in the system**: informs the user that `Patient`/`Doctor` already exists in the system.
-
-Why is this implemented this way?
-1. All query command closely resembles the structure of the `find` command. Each of the commands here have either stricter (i.e have stricter parameter requirements e.g `apptforpatient` and `apptfordoctor`) or looser (i.e searching for more fields e.g `patient` and `doctor`) predicates, but all generally have the same flow of control between the `Command`, `Logger` and `Model` classes.
-2. Conceptually, each of the 5 commands listed here are searching for different entities, and are hence split into separate commands despite having very similar structures.
+#### Incorrect user input handling process for the `Appointment` class
+The activity diagram below demonstrates this incorrect input handling process of a command that operates on the `Appointment` class.
+Specifically, we look at the process of adding an `Appointment` to MediCLI i.e. `addappt` command, potential mistakes that the user might make, and how they are handled by MediCLI.
-Alternative implementations considered
-1. The behaviour of `patient` and `doctor`, `apptforpatient` and `apptfordoctor` have similar requirements in terms of parameters, with the main difference being either `patient` or `doctor` typed classes. We might consider combining each pair into one command, and using flags to distinguish the desired class (e.g a -doctor or -patient flag to indicate we wish to search for only `doctor` and `patient` entries respectively) so as to avoid the need to create additional commands. However, we felt that at the time of implementation, separating the commands would be a cleaner strategy, and combining methods might overcomplicate the implementation.
-2. Even if we did proceed with combining, the combined command was to be overloaded with flags, we foresaw that the creation of distinct commands to fit the flags parsed were unavoidable. As such, it was prudent to start with the implementation of the distinct commands first, and leave the possibility of combining as a later increment.
+
+As visible, an incorrect input by the user can result in the following types of errors depending on the type of mistake:
+- **Command word is incorrect**: informs the user that command word is unowkown
+- **Missing required field arguments**: informs the user of invalid command format
+- **Invalid field arguments**: highlights to the user that invalid field arguments were provided
+- **`Patient`/`Doctor` involved in the `Appointment` does not exist in MediCLI**: informs the user that `Patient`/`Doctor` involved are not registered
+- **Provided date & time of the `Appointment` is in the past**: informs the user that appointments cannot be scheduled in the past.
+- **`Appointment` with corresponding attributes already exists in MediCLI**: informs the user that `Appointment` already exists
### \[Proposed\] Undo/redo feature
@@ -456,7 +337,7 @@ Alternative implementations considered
#### Proposed Implementation
-The proposed undo/redo mechanism is facilitated by `VersionedMediCLI`. It extends `MediCLI` with an undo/redo history, stored internally as an `mediCLIStateList` and `currentStatePointer`. Additionally, it implements the following operations:
+The proposed undo/redo mechanism is facilitated by `VersionedMediCLI`. It extends `MediCLI` with an undo/redo history, stored internally as an `MediCLIStateList` and `currentStatePointer`. Additionally, it implements the following operations:
* `VersionedMediCLI#commit()` — Saves the current MediCLI state in its history.
@@ -478,19 +359,19 @@ Step 1. The user launches the application for the first time. The `VersionedMed

-Step 2. The user executes `delete 5` command to delete the 5th person in the MediCLI. The `delete` command calls `Model#commitMediCLI()`, causing the modified state of the MediCLI after the `delete 5` command executes to be saved in the `mediCLIStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state.
+Step 2. The user executes `delete 5` command to delete the 5th person in the MediCLI. The `delete` command calls `Model#commitMediCLI()`, causing the modified state of the MediCLI after the `delete 5` command executes to be saved in the `MediCLIStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state.

-Step 3. The user executes `addpatient i/S1234567A n/John Doe d/2003-01-30 p/98765432` to add a new person. The `add` command also calls `Model#commitMediCLI()`, causing another modified MediCLI state to be saved into the `mediCLIStateList`.
+Step 3. The user executes `addpatient i/S1234567A n/John Doe d/2003-01-30 p/98765432` to add a new person. The `add` command also calls `Model#commitMediCLI()`, causing another modified MediCLI state to be saved into the `MediCLIStateList`.

-