From 8b98e4f3abe3b74c726fb280fb605e72dc585047 Mon Sep 17 00:00:00 2001 From: Jinil Sung Date: Fri, 11 Oct 2024 11:02:38 -0700 Subject: [PATCH] GRAD2-3006: task is complete. GRAD2-3006: task is complete. --- .../api/dataconversion/process/StudentProcess.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/process/StudentProcess.java b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/process/StudentProcess.java index 198312d..6a9a169 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/process/StudentProcess.java +++ b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/process/StudentProcess.java @@ -86,7 +86,7 @@ private void process(ConvGradStudent convGradStudent, List students, Co } GraduationStudentRecord gradStudent = processStudent(convGradStudent, st, ongoingUpdate, summary); if (gradStudent != null) { - processDependencies(convGradStudent, gradStudent, summary); + processDependencies(convGradStudent, gradStudent, summary, ongoingUpdate); } if (convGradStudent.getResult() == null) { @@ -145,13 +145,14 @@ private GraduationStudentRecord processStudent(ConvGradStudent convGradStudent, private void processDependencies(ConvGradStudent convGradStudent, GraduationStudentRecord gradStudent, - ConversionStudentSummaryDTO summary) { + ConversionStudentSummaryDTO summary, + boolean ongoingUpdate) { ConversionResultType result; // process dependencies gradStudent.setPen(convGradStudent.getPen()); - result = processOptionalPrograms(gradStudent, summary); + result = processOptionalPrograms(gradStudent, summary, ongoingUpdate); if (ConversionResultType.FAILURE != result) { result = processProgramCodes(gradStudent, convGradStudent.getProgramCodes(), summary); } @@ -208,7 +209,7 @@ private void convertStudentData(ConvGradStudent student, Student penStudent, Gra gradStudent.setUpdateUser(DEFAULT_UPDATED_BY); } - private ConversionResultType processOptionalPrograms(GraduationStudentRecord student, ConversionStudentSummaryDTO summary) { + private ConversionResultType processOptionalPrograms(GraduationStudentRecord student, ConversionStudentSummaryDTO summary, boolean ongoingUpdate) { if (StringUtils.isBlank(student.getProgram())) { return ConversionResultType.SUCCESS; } @@ -219,7 +220,7 @@ private ConversionResultType processOptionalPrograms(GraduationStudentRecord stu } // French Immersion for 2018-EN, 2004-EN, 1996-EN, 1986-EN - if (hasAnyFrenchImmersionCourse(student.getProgram(), student.getPen(), summary.getAccessToken())) { + if (!ongoingUpdate && hasAnyFrenchImmersionCourse(student.getProgram(), student.getPen(), summary.getAccessToken())) { return createStudentOptionalProgram("FI", student, summary); }