diff --git a/api/pom.xml b/api/pom.xml index fa02a6b..70fd29d 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ ca.bc.gov.educ educ-grad-data-conversion-api - 1.8.55 + 1.8.56 educ-grad-data-conversion-api Ministry of Education GRAD DATA CONVERSION API 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 fe82db8..fa723df 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 @@ -90,7 +90,7 @@ Delete All student related data ({STUDENT_API}/api/v1/student/conv/studentid/{st Update TRAX_STUDENT_NO status to NULL */ try { - restUtils.updateTraxStudentNo(new TraxStudentNo(pen, null, null), accessToken); + restUtils.deleteTraxStudentNo(new TraxStudentNo(pen, null, null), accessToken); } catch (Exception e) { logger.info("Exception thrown when trying to update TraxStudentNo."); } diff --git a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/util/EducGradDataConversionApiConstants.java b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/util/EducGradDataConversionApiConstants.java index 76ed6d7..e19c773 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/util/EducGradDataConversionApiConstants.java +++ b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/util/EducGradDataConversionApiConstants.java @@ -161,6 +161,9 @@ public class EducGradDataConversionApiConstants { @Value("${endpoint.grad-trax-api.student.save-trax-student-no.url}") private String saveTraxStudentNoUrl; + @Value("${endpoint.grad-trax-api.student.delete-trax-student-no.url}") + private String deleteTraxStudentNoUrl; + @Value("${endpoint.grad-graduation-report-api.delete-student-achievements.url}") private String deleteStudentAchievementsUrl; diff --git a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/util/RestUtils.java b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/util/RestUtils.java index 7c2b8dc..be1ff4d 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/dataconversion/util/RestUtils.java +++ b/api/src/main/java/ca/bc/gov/educ/api/dataconversion/util/RestUtils.java @@ -360,14 +360,13 @@ public TraxStudentNo saveTraxStudentNo(TraxStudentNo traxStudentNo, String acces .retrieve().bodyToMono(TraxStudentNo.class).block(); } - public TraxStudentNo updateTraxStudentNo(TraxStudentNo traxStudentNo, String accessToken) { - return webClient.put() - .uri(constants.getSaveTraxStudentNoUrl()) + public TraxStudentNo deleteTraxStudentNo(TraxStudentNo traxStudentNo, String accessToken) { + return webClient.delete() + .uri(String.format(constants.getDeleteTraxStudentNoUrl(),traxStudentNo)) .headers(h -> { h.setBearerAuth(accessToken); h.set(EducGradDataConversionApiConstants.CORRELATION_ID, ThreadLocalStateUtil.getCorrelationID()); }) - .body(BodyInserters.fromValue(traxStudentNo)) .retrieve().bodyToMono(TraxStudentNo.class).block(); } diff --git a/api/src/main/resources/application.yaml b/api/src/main/resources/application.yaml index ff295f5..d88727a 100644 --- a/api/src/main/resources/application.yaml +++ b/api/src/main/resources/application.yaml @@ -230,6 +230,8 @@ endpoint: url: ${GRAD_TRAX_API}api/v1/trax/common/student-master save-trax-student-no: url: ${GRAD_TRAX_API}api/v1/trax/common/trax-student-no + delete-trax-student-no: + url: ${GRAD_TRAX_API}api/v1/trax/common/trax-student-no/%s course: get-course-restrictions: url: ${GRAD_TRAX_API}api/v1/trax/common/course-restrictions diff --git a/api/src/test/resources/application.yaml b/api/src/test/resources/application.yaml index d36d6f5..146b108 100644 --- a/api/src/test/resources/application.yaml +++ b/api/src/test/resources/application.yaml @@ -157,6 +157,8 @@ endpoint: url: https://educ-grad-trax-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/trax/common/student-master save-trax-student-no: url: https://educ-grad-trax-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/trax/common/trax-student-no + delete-trax-student-no: + url: https://educ-grad-trax-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/trax/common/trax-student-no/%s course: get-course-restrictions: url: https://educ-grad-trax-api-77c02f-dev.apps.silver.devops.gov.bc.ca/api/v1/trax/common/course-restrictions