From 9c2d8629267dfc6c80e77d9abb0b4a13e1956294 Mon Sep 17 00:00:00 2001 From: githubmamatha Date: Wed, 6 Dec 2023 15:21:12 -0800 Subject: [PATCH] Gard2-2341 Part-6 setting the flags as per validations for ungraduated students. --- .../gradstudent/service/GraduationStatusService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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,