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 Issues in Edit Command #108

Merged

Conversation

wujy28
Copy link

@wujy28 wujy28 commented Oct 17, 2023

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

  1. Only kept the relevant attributes in EditCommand and EditCommandParser classes and removed the rest

Fixed bug in PatientBuilder and RecordBuilder

  1. Fixed the StackOverflow bug due to the two classes calling on each other's constructors in an endless loop by adding a new RecordBuilder constructor that takes in PatientBuilder as a parameter

Fixed Checkstyle Issues

  1. Fixed all existing 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...

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.
@wujy28 wujy28 added the priority.High Must do label Oct 17, 2023
@wujy28 wujy28 added this to the v1.2b milestone Oct 17, 2023
Copy link

@thienmy0 thienmy0 left a 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

Comment on lines +27 to +32
.withName("Alice Pauline")
.withAddress("123, Jurong West Ave 6, #08-111")
.withEmail("alice@example.com")
.withGender("female")
.withBirthday("23/09/2000")
.withIcNumber("T0032415E")

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!

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 :)

Comment on lines -16 to +30
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;

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[]{

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)?

Copy link

@longnguyentan longnguyentan left a 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

@longnguyentan longnguyentan merged commit 1da5292 into AY2324S1-CS2103T-T14-2:master Oct 18, 2023
0 of 3 checks passed
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.

None yet

3 participants