Skip to content

Commit

Permalink
GRAD2-2591
Browse files Browse the repository at this point in the history
Optional Program Completion Date is not being reset when a User UNGRADS a student
  • Loading branch information
arybakov-cgi committed Sep 11, 2024
1 parent 61690d7 commit c5a5f30
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,13 @@ public Pair<GraduationStudentRecord, GradStatusEvent> undoCompletionStudent(UUID
if (gradStatusEvent != null) {
gradStatusEventRepository.save(gradStatusEvent);
}
List<StudentOptionalProgramEntity> studentOptionalProgramEntities = gradStudentOptionalProgramRepository.findByStudentID(studentID);
for(StudentOptionalProgramEntity studentOptionalProgramEntity: studentOptionalProgramEntities) {
studentOptionalProgramEntity.setOptionalProgramCompletionDate(null);
studentOptionalProgramEntity.setStudentOptionalProgramData(null);
gradStudentOptionalProgramRepository.save(studentOptionalProgramEntity);
historyService.createStudentOptionalProgramHistory(studentOptionalProgramEntity,USER_UNDO_CMPL);
}
return Pair.of(graduationStatusTransformer.transformToDTOWithModifiedProgramCompletionDate(gradEntity), gradStatusEvent);
} else {
validation.addErrorAndStop(String.format("Student ID [%s] does not exists", studentID));
Expand Down

0 comments on commit c5a5f30

Please sign in to comment.