diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java index 8476f481..4e453efc 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java @@ -220,7 +220,12 @@ public Pair updateGraduationStatus(UUI } else { deleteStudentAchievements(sourceObject.getStudentID(), accessToken); } - } else { + } + + BeanUtils.copyProperties(sourceObject, gradEntity, CREATE_USER, CREATE_DATE, "studentGradData", "studentProjectedGradData", "recalculateGradStatus", "recalculateProjectedGrad"); + gradEntity.setProgramCompletionDate(sourceObject.getProgramCompletionDate()); + gradEntity.setUpdateUser(null); + if(!hasDataChanged.hasDataChanged()) { if ("".equals(sourceObject.getRecalculateGradStatus()) || "N".equalsIgnoreCase(sourceObject.getRecalculateGradStatus())) { gradEntity.setRecalculateGradStatus(null); } else { @@ -232,11 +237,6 @@ public Pair updateGraduationStatus(UUI gradEntity.setRecalculateProjectedGrad(sourceObject.getRecalculateProjectedGrad()); } } - - - BeanUtils.copyProperties(sourceObject, gradEntity, CREATE_USER, CREATE_DATE, "studentGradData", "studentProjectedGradData", "recalculateGradStatus", "recalculateProjectedGrad"); - gradEntity.setProgramCompletionDate(sourceObject.getProgramCompletionDate()); - gradEntity.setUpdateUser(null); gradEntity = graduationStatusRepository.saveAndFlush(gradEntity); historyService.createStudentHistory(gradEntity, USER_EDIT); final GradStatusEvent gradStatusEvent = createGradStatusEvent(gradEntity.getUpdateUser(), gradEntity,