Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRAD2-3006: task is complete. #342

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void process(ConvGradStudent convGradStudent, List<Student> 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) {
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);
}

Expand Down
Loading