Skip to content

Commit

Permalink
Merge pull request #686 from bcgov/grad-release
Browse files Browse the repository at this point in the history
Grad release 1.23.3
  • Loading branch information
githubmamatha authored Sep 23, 2024
2 parents 55593d4 + 42592d4 commit 464776c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
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-student-api</artifactId>
<version>1.8.64</version>
<version>1.8.65</version>
<name>educ-grad-student-api</name>
<description>Student Demographics API for GRAD team</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,15 @@ 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);
studentOptionalProgramEntity.setUpdateDate(LocalDateTime.now());
studentOptionalProgramEntity.setUpdateUser(ThreadLocalStateUtil.getCurrentUser());
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
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,14 @@ public void testUgradStudent() throws JsonProcessingException {
when(graduationStatusRepository.findById(studentID)).thenReturn(Optional.of(graduationStatusEntity));
when(graduationStatusRepository.save(responseGraduationStatus)).thenReturn(responseGraduationStatus);

StudentOptionalProgramEntity studentOptionalProgramEntity = new StudentOptionalProgramEntity();
studentOptionalProgramEntity.setId(UUID.randomUUID());
studentOptionalProgramEntity.setStudentID(studentID);
studentOptionalProgramEntity.setOptionalProgramCompletionDate(new Date(System.currentTimeMillis()));

when(gradStudentOptionalProgramRepository.findByStudentID(studentID)).thenReturn(List.of(studentOptionalProgramEntity));
doNothing().when(historyService).createStudentOptionalProgramHistory(any(), any());

var response = graduationStatusService.undoCompletionStudent(studentID, ungradReasonCode,ungradReasonDesc, "accessToken");
assertThat(response).isNotNull();

Expand Down

0 comments on commit 464776c

Please sign in to comment.