Batch student status update#62
Conversation
files edited: - EditCommand.java: added status and classCode in isAnyFieldEdited() method to cater for the 2 fields.
Edited files: 1. EditCommand.java: Added comments to document approach to the feature.
and findclasscode - Update own PPP to record new changes
…t-command Add checks for Status and ClassCode
|
Checkstyle:
|
…command Update UG and own PPP
|
Minor checkstyle errors detected by Java CI. |
Updated personal PPP
- FindStatusTest - FindStatusCommandParserTest - StatusContainsKeywordsPredicateTest - StatusTest
…command Implement JUnit Tests for Status and Status-related functions
|
Closed since changes have been made and updated in #70 and 71 |
…atch_update_info Add filtered list by ClassCode and validation of student
…o batch-student-status-update
Codecov Report
@@ Coverage Diff @@
## master #62 +/- ##
============================================
- Coverage 72.22% 71.25% -0.97%
- Complexity 419 439 +20
============================================
Files 72 78 +6
Lines 1314 1381 +67
Branches 141 152 +11
============================================
+ Hits 949 984 +35
- Misses 320 353 +33
+ Partials 45 44 -1
Continue to review full report at Codecov.
|
| if (personToEdit.getStatus().toString().equals(Status.NEGATIVE) | ||
| && editedPerson.getStatus().toString().equals(Status.POSITIVE)) { | ||
|
|
||
| List<Person> filteredByClassCodeList = studentList.stream() | ||
| .filter(student -> student.getClassCode().toString().equals(editedPerson.getClassCode().toString()) | ||
| && !student.isSamePerson(editedPerson)) | ||
| .collect(Collectors.toList()); | ||
|
|
||
| for (int i = 0; i < filteredByClassCodeList.size(); i++) { | ||
| Person currentPerson = filteredByClassCodeList.get(i); | ||
| EditPersonDescriptor tempDescriptor = new EditPersonDescriptor(); | ||
| tempDescriptor.setStatus(new Status(Status.CLOSE_CONTACT)); | ||
| Person editedPersonStatus = createEditedPerson(currentPerson, tempDescriptor); | ||
| model.setPerson(currentPerson, editedPersonStatus); | ||
| } | ||
| } |
There was a problem hiding this comment.
Should we also handle the case where a student's status has changed from positive to negative? When a student has recovered, their classmates' status should be negative instead of close contact if there is no more positive student in the class.
|
Looks good! |
|
Might need to consider an edge case where already Positive student should not be changed to close-contact upon update of a different student |
No description provided.