Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DG #217

Merged
merged 5 commits into from
Apr 12, 2024
Merged

Update DG #217

merged 5 commits into from
Apr 12, 2024

Conversation

Alteqa
Copy link
Collaborator

@Alteqa Alteqa commented Apr 12, 2024

No description provided.

@Alteqa Alteqa added this to the v1.4 milestone Apr 12, 2024
@Alteqa Alteqa self-assigned this Apr 12, 2024
@Alteqa Alteqa changed the title Updatge DG Update DG Apr 12, 2024
* Step 7. The `execute` method in `editCommand` also iterates through the `ObservableList<Appointments>` and retrieves all appointments that have the person to be edited, and calls the `setDoctorNric` or `setPatientNric` methods to update all relevant appointments related to the patient or doctor.
* Step 8. 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 `DeleteCommand`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to editCommand


### Edit `Appointment`
Edits an `Appointment` entry by indicating their `Index`.
This command is implemented through the `EditAppointmentCommand` class which extend the `Command` class.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extends


<img src="images/EditAppointmentActivityDiagram.png" width="800" />

* Step 4. The `parse` command in `editAppointmentCommandParser` return an instance of `editAppointmentCommand`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returns

* 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 `DeleteAppointmentCommand`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EditAppointmentCommand

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation before 3.

Copy link
Collaborator

@alfaloo alfaloo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing

@alfaloo alfaloo merged commit 26eec79 into AY2324S2-CS2103T-T15-1:master Apr 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants