Skip to content

Commit

Permalink
Grad Release 1.2.2 sync
Browse files Browse the repository at this point in the history
Grad Release 1.2.2 sync
  • Loading branch information
kamal-mohammed authored Jul 10, 2023
2 parents 7db0cd6 + c22f3d1 commit b3caed9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ca.bc.gov.educ</groupId>
<artifactId>educ-grad-data-conversion-api</artifactId>
<version>1.8.44</version>
<version>1.8.45</version>
<name>educ-grad-data-conversion-api</name>
<description>Ministry of Education GRAD DATA CONVERSION API</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1135,23 +1135,25 @@ public void saveGraduationStudent(StudentGradDTO gradStudent, String accessToken
}

private void removeAndReCreateOptionalPrograms(StudentGradDTO gradStudent, String accessToken) {
List<String> optionalProgramCodes = new ArrayList<>();

// Remove all optional programs
List<StudentOptionalProgram> studentOptionalPrograms = restUtils.getStudentOptionalPrograms(gradStudent.getStudentID().toString(), accessToken);
studentOptionalPrograms.forEach(op -> {
log.info(" => [{}] optional program will be removed if exist.", op.getOptionalProgramCode());
removeStudentOptionalProgram(op.getOptionalProgramID(), gradStudent, accessToken);
if (isOptionalProgramRecreationRequired(op.getOptionalProgramCode())) {
optionalProgramCodes.add(op.getOptionalProgramCode());
}
});
if (studentOptionalPrograms != null && !studentOptionalPrograms.isEmpty()) {
List<String> optionalProgramCodes = new ArrayList<>();

// Recreate nonFI & nonDD optional programs
optionalProgramCodes.forEach(opc -> {
log.info(" => [{}] optional program will be re-created.", opc);
addStudentOptionalProgram(opc, gradStudent, true, accessToken);
});
studentOptionalPrograms.forEach(op -> {
log.info(" => [{}] optional program will be removed if exist.", op.getOptionalProgramCode());
removeStudentOptionalProgram(op.getOptionalProgramID(), gradStudent, accessToken);
if (isOptionalProgramRecreationRequired(op.getOptionalProgramCode())) {
optionalProgramCodes.add(op.getOptionalProgramCode());
}
});

// Recreate nonFI & nonDD optional programs
optionalProgramCodes.forEach(opc -> {
log.info(" => [{}] optional program will be re-created.", opc);
addStudentOptionalProgram(opc, gradStudent, true, accessToken);
});
}
}

private void handleFIorDDOptionalProgram(StudentGradDTO gradStudent, String accessToken) {
Expand Down

0 comments on commit b3caed9

Please sign in to comment.