Skip to content

Commit

Permalink
Grad release 1.11.0
Browse files Browse the repository at this point in the history
Grad release 1.11.0
  • Loading branch information
kamal-mohammed authored Dec 11, 2023
2 parents cf40be6 + aca0628 commit 61cbabc
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ public GraduationStudentRecord updateGraduationStatusByFields(OngoingUpdateReque
@Retry(name = "generalpostcall")
public StudentOptionalProgram saveStudentOptionalProgram(StudentOptionalProgramRequestDTO studentOptionalProgramReq, String accessToken) {
if (studentOptionalProgramReq.getOptionalProgramID() == null) {
Optional<GraduationStudentRecordEntity> gradStatusOptional = graduationStatusRepository.findById(studentOptionalProgramReq.getStudentID());
if (gradStatusOptional.isPresent()) {
String currentGradProgramCode = gradStatusOptional.get().getProgram();
// GRAD2-2412: concurrency issue as grad program might be changed by another event by a millisecond.
// => if the requested grad program is different from the current grad program, then use the existing one.
if (!StringUtils.equalsIgnoreCase(studentOptionalProgramReq.getMainProgramCode(), currentGradProgramCode)) {
studentOptionalProgramReq.setMainProgramCode(currentGradProgramCode);
}
}
OptionalProgram gradOptionalProgram = getOptionalProgram(studentOptionalProgramReq.getMainProgramCode(), studentOptionalProgramReq.getOptionalProgramCode(), accessToken);
if (gradOptionalProgram == null) {
return null;
Expand Down

0 comments on commit 61cbabc

Please sign in to comment.