-
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
Add remark feature #63
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #63 +/- ##
============================================
+ Coverage 76.18% 76.88% +0.70%
- Complexity 474 496 +22
============================================
Files 75 78 +3
Lines 1503 1579 +76
Branches 154 164 +10
============================================
+ Hits 1145 1214 +69
- Misses 314 318 +4
- Partials 44 47 +3 ☔ View full report in Codecov by Sentry. |
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.
Thank you for your work Ervin, it definitely did not seem easy.
Just have a few questions that I'd like to clarify before merging:
- Is Remark compulsory in your implementation? Because from what I understand, it is optional.
- There is a missing RemarkCommandParserTest for your implementation. You can refer to AddCommandParserTest and add some tests for this.
person.getTags().forEach(builder::append); | ||
builder.append("\n Remarks: ") | ||
.append(person.getRemark()); | ||
return builder.toString(); |
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.
Just a nit, but do you wanna do this instead?
public static String format(Person person) {
final StringBuilder builder = new StringBuilder();
builder.append(person.getName())
.append("\n IC: ")
.append(person.getIc())
.append("\n DOB: ")
.append(person.getDob())
.append("\n Ward: ")
.append(person.getWard())
.append("\n Admitted: ")
.append(person.getAdmissionDate())
.append("\n Remarks: ")
.append(person.getRemark());
.append("\n Tags: ");
person.getTags().forEach(builder::append);
return builder.toString();
*/ | ||
public class RemarkCommandTest { | ||
|
||
private static final String REMARK_STUB = "Some remark"; |
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 may be wrong, but I feel like this would be more appropriately named SAMPLE_REMARK instead. Stub implies that it might be a module that is being substituted
.withAdmissionDate("01/03/2024").withWard("A1").build(); | ||
.withAdmissionDate("01/03/2024").withWard("A1").withRemark("This is a remark.").build(); | ||
public static final Person BENSON = new PersonBuilder().withName("Benson Meier") | ||
.withTags("Dementia", "FallRisk").withDob("20/02/2001") | ||
.withIc("A2345678B").withAdmissionDate("01/02/2024").withWard("B1").build(); | ||
.withIc("A2345678B").withAdmissionDate("01/02/2024").withWard("B1").withRemark("This is a remark.").build(); | ||
public static final Person CARL = new PersonBuilder().withName("Carl Kurz").withDob("20/02/2002") | ||
.withIc("A3456789B").withAdmissionDate("05/03/2024").withWard("C1").build(); | ||
.withIc("A3456789B").withAdmissionDate("05/03/2024").withWard("C1").withRemark("This is a remark.").build(); | ||
public static final Person DANIEL = new PersonBuilder().withName("Daniel Meier").withTags("HearingImpaired") | ||
.withDob("20/02/2003").withIc("A5678901B").withAdmissionDate("10/03/2024") | ||
.withWard("D1").build(); | ||
.withWard("D1").withRemark("This is a remark.").build(); | ||
public static final Person ELLE = new PersonBuilder().withName("Elle Meyer").withDob("20/02/2004") | ||
.withIc("A4756976B").withAdmissionDate("05/02/2024").withWard("E1").build(); | ||
.withIc("A4756976B").withAdmissionDate("05/02/2024").withWard("E1").withRemark("This is a remark.").build(); | ||
public static final Person FIONA = new PersonBuilder().withName("Fiona Kunz").withDob("20/02/2006") | ||
.withIc("A5739485B").withAdmissionDate("11/03/2024").withWard("F1").build(); | ||
.withIc("A5739485B").withAdmissionDate("11/03/2024").withWard("F1").withRemark("This is a remark.").build(); | ||
public static final Person GEORGE = new PersonBuilder().withName("George Best").withDob("20/05/2000") | ||
.withIc("A0987654B").withAdmissionDate("16/03/2024").withWard("G1").build(); | ||
.withIc("A0987654B").withAdmissionDate("16/03/2024").withWard("G1").withRemark("This is a remark.").build(); |
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.
- Is a remark compulsory? Is it possible to make it optional, just like tags?
- Maybe we can use more relevant remarks for this part, such as "Patient has limited vision capabilities"
/** | ||
* Changes the remark of an existing person in the address book. | ||
*/ |
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.
Does this allow adding of remarks? More detail here would be good
Dob dob, Ic ic, AdmissionDate admissionDate, Ward ward) { | ||
requireAllNonNull(name, dob, ic, admissionDate, ward); | ||
Dob dob, Ic ic, AdmissionDate admissionDate, Ward ward, Remark remark) { | ||
requireAllNonNull(name, dob, ic, admissionDate, ward, remark, tags); |
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 believe remarks was optional, unless I am wrong. Should we exclude remarks from requireNonNull?
new Ic("S1234567A"), new AdmissionDate("05/01/2022"), new Ward("WE")), | ||
new Ic("S1234567A"), new AdmissionDate("05/01/2022"), new Ward("WE"), new Remark("")), | ||
new Person(new Name("Roy Balakrishnan"), getTagSet("Dementia"), new Dob("01/01/1990"), | ||
new Ic("S1234567A"), new AdmissionDate("06/01/2022"), new Ward("WF")) | ||
new Ic("S1234567A"), new AdmissionDate("06/01/2022"), new Ward("WF"), new Remark("")) |
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.
One or two of sample person can have a sample remark too, instead of blank
AdmissionDate admissionDate = | ||
ParserUtil.parseAdmissionDate(argMultimap.getValue(PREFIX_ADMISSION_DATE).orElse(null)); | ||
Ward ward = ParserUtil.parseWard(argMultimap.getValue(PREFIX_WARD).orElse(null)); | ||
|
||
|
||
Person person = new Person(name, tagList, dob, ic, admissionDate, ward); | ||
Remark remark = new Remark(""); | ||
Person person = new Person(name, tagList, dob, ic, admissionDate, ward, remark); |
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.
Are we having a parseRemark() method for this? Or remarks have to be added seperately.
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. You may wanna add RemarkTest.java too, but that might be optional.
@ryanlimdx @ejnan @swtan346 is there any feedback? If not, we'll merge it soon, so we can test for potential bugs.
Closes #38