From 72b8a46e0a7fed75ffe5dc6967a4caa79ade3680 Mon Sep 17 00:00:00 2001 From: Kamal Mohammed Date: Mon, 18 Mar 2024 17:46:33 -0600 Subject: [PATCH] GRAD2-2465 - Delete a student and related data --- .../service/student/StudentService.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/service/student/StudentService.java b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/service/student/StudentService.java index b3ea1ac2..fe82db82 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/service/student/StudentService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/service/student/StudentService.java @@ -70,18 +70,30 @@ Delete All student related data ({STUDENT_API}/api/v1/student/conv/studentid/{st STUDENT_RECORD_NOTE, STUDENT_CAREER_PROGRAMS, STUDENT_OPTIONAL_PROGRAM_HISTORY, STUDENT_OPTIONAL_PROGRAM, GRADUATION_STUDENT_RECORD_HISTORY, GRADUATION_STUDENT_RECORD */ - restUtils.removeAllStudentRelatedData(UUID.fromString(studentID), accessToken); + try { + restUtils.removeAllStudentRelatedData(UUID.fromString(studentID), accessToken); + } catch (Exception e) { + logger.info("Exception thrown when trying to delete student related data from grad student API."); + } /* Delete all Student certificates, transcripts and reports from API_GRAD_REPORT schema Tables: STUDENT_CERTIFICATE, STUDENT_TRANSCRIPT and STUDENT_REPORT */ - restUtils.removeAllStudentAchievements(UUID.fromString(studentID), accessToken); + try { + restUtils.removeAllStudentAchievements(UUID.fromString(studentID), accessToken); + } catch (Exception e) { + logger.info("Exception thrown when trying to delete student achievements."); + } /* Update TRAX_STUDENT_NO status to NULL */ - restUtils.updateTraxStudentNo(new TraxStudentNo(pen, null, null), accessToken); + try { + restUtils.updateTraxStudentNo(new TraxStudentNo(pen, null, null), accessToken); + } catch (Exception e) { + logger.info("Exception thrown when trying to update TraxStudentNo."); + } } return pen; }