Skip to content

Commit

Permalink
Clean up the codes.
Browse files Browse the repository at this point in the history
Clean up the codes.
  • Loading branch information
infstar committed Sep 23, 2024
1 parent 68ab469 commit 1b48b50
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,29 +130,6 @@ protected void populateNewBatchFlags(StudentGradDTO currentStudent) {
}
}

protected void validateAndAdjustNewBatchFlags(StudentGradDTO currentStudent) {
String currentStudentStatus = currentStudent.getStudentStatus();
String newStudentStatus = currentStudent.getNewStudentStatus();
// 1. If a student in GRAD is ARC/TER then do not set TVR flag
if (STUDENT_STATUS_ARCHIVED.equalsIgnoreCase(currentStudentStatus) || STUDENT_STATUS_TERMINATED.equalsIgnoreCase(currentStudentStatus)) {
currentStudent.setNewRecalculateProjectedGrad(null);
}
// 2. If a student in GRAD is MER then do not set Transcript & TVR flags
if (STUDENT_STATUS_MERGED.equalsIgnoreCase(currentStudentStatus)) {
currentStudent.setNewRecalculateGradStatus(null);
currentStudent.setNewRecalculateProjectedGrad(null);
}
// 3. If a student in GRAD is changed to ARC/TER then set TVR flag to NULL
if (STUDENT_STATUS_ARCHIVED.equalsIgnoreCase(newStudentStatus) || STUDENT_STATUS_TERMINATED.equalsIgnoreCase(newStudentStatus)) {
currentStudent.setNewRecalculateProjectedGrad(NULL_VALUE);
}
// 4. If a student in GRAD is changed to MER then set Transcript & TVR flags to NULL
if (STUDENT_STATUS_MERGED.equalsIgnoreCase(newStudentStatus)) {
currentStudent.setNewRecalculateGradStatus(NULL_VALUE);
currentStudent.setNewRecalculateProjectedGrad(NULL_VALUE);
}
}

private void updateProgramCountsInSummary(ConversionStudentSummaryDTO summary, String programCode, boolean isGraduated) {
if (summary != null) {
summary.increment(programCode, isGraduated);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public <T extends Object> void processEvent(T request, Event event) {

public void processStudent(TraxGraduationUpdateDTO updateGrad, StudentGradDTO currentStudent, String accessToken) {
boolean isChanged = false;
boolean isStudentStatusChanged = false;

log.info(" Process Student : studentID = {}, pen = {}", currentStudent.getStudentID(), updateGrad.getPen());
// Processing order is important for the first 3 fields below.
Expand Down Expand Up @@ -114,13 +113,9 @@ public void processStudent(TraxGraduationUpdateDTO updateGrad, StudentGradDTO cu
processStudentStatus(currentStudent, newStudentStatus);
log.info(" => student status : current = {}, request = {}", currentStudent.getStudentStatus(), currentStudent.getNewStudentStatus());
isChanged = true;
isStudentStatusChanged = true;
}

if (isChanged) {
if (isStudentStatusChanged) {
validateAndAdjustNewBatchFlags(currentStudent);
}
log.info(" Save Student : studentID = {}, pen = {}", currentStudent.getStudentID(), updateGrad.getPen());
studentProcess.saveGraduationStudent(updateGrad.getPen(), currentStudent, UPD_GRAD, accessToken);
}
Expand Down

0 comments on commit 1b48b50

Please sign in to comment.