From b80f18456f96c8c54045fd67cf56da2bd8219ff7 Mon Sep 17 00:00:00 2001 From: Jinil Sung Date: Thu, 17 Oct 2024 09:13:39 -0700 Subject: [PATCH] GRAD2-3000: removed the slp date validation for SCCP & enhanced the error reporting. GRAD2-3000: removed the slp date validation for SCCP & enhanced the error reporting. --- .../process/StudentProcess.java | 19 ------------------- .../student/NewStudentEventService.java | 3 +++ 2 files changed, 3 insertions(+), 19 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 6a9a169..626b671 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 @@ -53,11 +53,6 @@ public ConvGradStudent convertStudent(ConvGradStudent convGradStudent, Conversio return convGradStudent; } - // Program Completion for graduated student - if (!validateProgramCompletionDate(convGradStudent, summary)) { - return convGradStudent; - } - // Student conversion process process(convGradStudent, students, summary, reload, ongoingUpdate); @@ -619,20 +614,6 @@ private void handleAdultStartRule(Student penStudent, GraduationStudentRecord gr } } - /** - * - * @return true Valid - * false Bad data (programCompletionDate is null) - */ - private boolean validateProgramCompletionDate(ConvGradStudent convGradStudent, ConversionStudentSummaryDTO summary) { - if ("SCCP".equalsIgnoreCase(convGradStudent.getGraduationRequirementYear()) && - StringUtils.isBlank(convGradStudent.getSlpDate())) { - handleException(convGradStudent, summary, convGradStudent.getPen(), ConversionResultType.FAILURE, "Bad data: slp_date is null for SCCP"); - return false; - } - return true; - } - /** * * @return true Valid diff --git a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/service/student/NewStudentEventService.java b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/service/student/NewStudentEventService.java index 7c8b9ff..3e0ed08 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/service/student/NewStudentEventService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/service/student/NewStudentEventService.java @@ -63,6 +63,9 @@ public void processEvent(T request, Event event) { return; } if (result == null || ConversionResultType.FAILURE.equals(result.getResult())) { + if (!summary.getErrors().isEmpty()) { + summary.getErrors().forEach(e -> log.error("Load is failed for {} - {}", e.getItem(), e.getReason())); + } return; } }