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

Fix AppointmentBook to accurately reflect changes in Patient details #97

Merged
merged 4 commits into from
Oct 21, 2021

Conversation

joshenx
Copy link

@joshenx joshenx commented Oct 21, 2021

Description

AppointmentBook does not reflect changes in Patient details, whether Patient is updated through edit or delete.
We should update changes in Patient details in Appointments containing that Patient, and delete upcoming Appointments when a Patient is removed.

I have added methods in Model to update the AppointmentBook when the EditPatientCommand or DeletePatientCommand commands is executed.

I also fixed minor typos and errors in examples/parameters.

Closes #89.
Fixes #83.

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • Requires Developer Guide Update

@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2021

Codecov Report

Merging #97 (b83c63e) into master (0f79e1b) will decrease coverage by 0.07%.
The diff coverage is 46.15%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #97      +/-   ##
============================================
- Coverage     63.03%   62.95%   -0.08%     
- Complexity      484      489       +5     
============================================
  Files            92       92              
  Lines          1718     1744      +26     
  Branches        175      180       +5     
============================================
+ Hits           1083     1098      +15     
- Misses          582      589       +7     
- Partials         53       57       +4     
Impacted Files Coverage Δ
src/main/java/seedu/address/model/Model.java 100.00% <ø> (ø)
...main/java/seedu/address/model/AppointmentBook.java 55.55% <25.00%> (-16.86%) ⬇️
...rc/main/java/seedu/address/model/ModelManager.java 71.59% <71.42%> (+3.68%) ⬆️
...u/address/logic/commands/DeletePatientCommand.java 100.00% <100.00%> (ø)
...edu/address/logic/commands/EditPatientCommand.java 97.33% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f79e1b...b83c63e. Read the comment docs.

@gycgabriel gycgabriel added this to the v1.3 milestone Oct 21, 2021
Copy link

@gycgabriel gycgabriel left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing issue #89!

@joshenx joshenx merged commit 0981ea6 into master Oct 21, 2021
Comment on lines +161 to +176
@Override
public void updateAppointmentBook(Patient target, Patient editedPatient) {
requireAllNonNull(target, editedPatient);

appointmentBook.updatePatient(target, editedPatient);
}

@Override
public void updateAppointmentBook(Patient target, boolean isPatientRemoval) {
if (isPatientRemoval) {
appointmentBook.removePatient(target);
} else {
logger.log(Level.INFO, "No changes were made to Patient name: " + target.getName());
}
}

Copy link

@gycgabriel gycgabriel Oct 21, 2021

Choose a reason for hiding this comment

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

Opened issue #98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants