-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
…whether update/removal
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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!
@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()); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened issue #98
Description
AppointmentBook does not reflect changes in Patient details, whether Patient is updated through
edit
ordelete
.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 theAppointmentBook
when theEditPatientCommand
orDeletePatientCommand
commands is executed.I also fixed minor typos and errors in examples/parameters.
Closes #89.
Fixes #83.
Type of change: