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

Add appointment feature #42

Closed
wants to merge 0 commits into from

Conversation

reidenong
Copy link

Fixes #41

@reidenong reidenong added the priority.High Must do label Oct 8, 2024
@reidenong reidenong added this to the v1.2 milestone Oct 8, 2024
@reidenong reidenong self-assigned this Oct 8, 2024
Copy link

@itsnotsherm itsnotsherm left a comment

Choose a reason for hiding this comment

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

LGTM, nice implementation just make sure checkstyle is adhered to before merging

Choose a reason for hiding this comment

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

neat implementation

Choose a reason for hiding this comment

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

thanks for the detailed comments, code is easily understandable

/**
* Returns true if a given string is a valid appointment date.
*/
public static boolean isValidAppointment(String test) {

Choose a reason for hiding this comment

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

maybe this method can be in the appropriate parser instead?

Copy link
Author

Choose a reason for hiding this comment

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

Agreed, moved to parser. thanks

@@ -94,13 +104,14 @@ public boolean equals(Object other) {
&& phone.equals(otherPerson.phone)
&& email.equals(otherPerson.email)
&& address.equals(otherPerson.address)
&& tags.equals(otherPerson.tags);
&& tags.equals(otherPerson.tags)
&& Objects.equals(appointment, otherPerson.appointment); // Include appointment in equality check

Choose a reason for hiding this comment

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

could appointment.equals(otherPerson.appointment) work? think narrowing the scope might be safer

Copy link
Author

@reidenong reidenong Oct 10, 2024

Choose a reason for hiding this comment

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

Currently, appointment is deemed as an optional field, as not all patients may have an appointment.

For patients without appointments, their appointment variable holds a null value. With this implementation, appointment.equals(otherPerson.appointment) will trigger a NullPointerException if appointment is null. Using Object.equals() helps to prevent that.

I am also not too sure if this is the best way to go about doing it, can discuss?

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 10.52632% with 102 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...address/logic/parser/AppointmentCommandParser.java 0.00% 43 Missing ⚠️
...edu/address/logic/commands/AppointmentCommand.java 0.00% 25 Missing ⚠️
...n/java/seedu/address/model/person/Appointment.java 0.00% 13 Missing ⚠️
.../java/seedu/address/storage/JsonAdaptedPerson.java 41.66% 5 Missing and 2 partials ⚠️
.../java/seedu/address/model/util/SampleDataUtil.java 0.00% 6 Missing ⚠️
...c/main/java/seedu/address/model/person/Person.java 55.55% 3 Missing and 1 partial ⚠️
src/main/java/seedu/address/ui/PersonCard.java 0.00% 3 Missing ⚠️
.../seedu/address/logic/parser/AddressBookParser.java 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ Complexity Δ
...java/seedu/address/logic/commands/EditCommand.java 97.43% <100.00%> (ø) 13.00 <0.00> (ø)
...a/seedu/address/logic/parser/AddCommandParser.java 100.00% <100.00%> (ø) 5.00 <0.00> (ø)
.../seedu/address/logic/parser/AddressBookParser.java 90.47% <0.00%> (-9.53%) 12.00 <0.00> (ø)
src/main/java/seedu/address/ui/PersonCard.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...c/main/java/seedu/address/model/person/Person.java 90.47% <55.55%> (-6.75%) 20.00 <1.00> (+1.00) ⬇️
.../java/seedu/address/model/util/SampleDataUtil.java 20.00% <0.00%> (ø) 1.00 <0.00> (ø)
.../java/seedu/address/storage/JsonAdaptedPerson.java 87.03% <41.66%> (-12.97%) 11.00 <0.00> (ø)
...n/java/seedu/address/model/person/Appointment.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...edu/address/logic/commands/AppointmentCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...address/logic/parser/AppointmentCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)

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

Successfully merging this pull request may close these issues.

Appointment Feature
2 participants