-
Notifications
You must be signed in to change notification settings - Fork 5
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 Issues in Edit Command #108
Fix Issues in Edit Command #108
Conversation
Currently, the EditCommand and EditCommandParser classes are inconsistent in that they contain methods that process patient attributes that are not parameters into the Edit command, or certain parts lack the processing of important attributes. Fixing this issue will prevent further bugs and lead to neater code. Let's, * Add and remove attributes in the two classes for consistency * Make sure that important attributes are mentioned in parts that were previously lacking them
There is an issue where after PatientBuilder() is called, it will call RecordBuilder(), which in turn calls PatientBuilder() again, causing a StackOverflow error. We need to fix this to get our test cases to pass. Let's * Add a new constructor to RecordBuilder that takes in a PatientBuilder to initialize its patient, instead of calling PatientBuilder again * Add new attributes to TypicalPatients Note that not all of the fields in Typical Patients are updated! AMY and BOB still need to be updated, which involves adding new attributes into CommandTestUtilgit add --all
The existing console messages do not display the new attributes, confusing the user as to what attributes are available. Adding them to the messages allow them to view all the patient's attributes even without the updated GUI. Let's update the Add command and patient messages.
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.
I've looked through your changes and couldn't find much issues. Good job! Would be good to wait for the second reviewer before merging
.withName("Alice Pauline") | ||
.withAddress("123, Jurong West Ave 6, #08-111") | ||
.withEmail("alice@example.com") | ||
.withGender("female") | ||
.withBirthday("23/09/2000") | ||
.withIcNumber("T0032415E") |
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.
I like how you adapted the TypicalPatients class to include our newly added fields!
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.
Agree with @thienmy0 on this point :)
import seedu.address.model.patient.*; | ||
import seedu.address.model.patient.Address; | ||
import seedu.address.model.patient.Birthday; | ||
import seedu.address.model.patient.Email; | ||
import seedu.address.model.patient.Gender; | ||
import seedu.address.model.patient.IcNumber; | ||
import seedu.address.model.patient.Name; | ||
import seedu.address.model.patient.Patient; | ||
import seedu.address.model.patient.Phone; |
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.
I like how you changed the import statements since * should be avoided!
getTagSet("classmates")), new Patient(new Name("Roy Balakrishnan"), new Phone("92624417"), | ||
new Email("royb@example.com"), new Gender("Male"), new IcNumber("t6789031q"), new Birthday("07/11/1976"), | ||
new Address("Blk 45 Aljunied Street 85, #11-31"), getTagSet("colleagues"))}; | ||
return new Patient[]{ |
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.
Shall we create constant variables for this (so when we modify the Patient constructor, it would be easier to update this class)?
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.
Overall is good :) Thanks for your hard work
1da5292
into
AY2324S1-CS2103T-T14-2:master
Fix Issues in Edit Command
Fixed inconsistencies in attributes for EditCommand and EditCommandParser, as well as fixed a bug
Key changes
Made attributes utilized in Edit Command consistent
Fixed bug in PatientBuilder and RecordBuilder
Fixed Checkstyle Issues
NOTE: There are still 23 bugs to rectify... Guys, please remember to run checkstyle and test cases before pushing if you have not been doing so...