Skip to content

Commit

Permalink
GRAD2-2587 (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamal-mohammed authored Apr 4, 2024
1 parent 1a3e6a8 commit cb337da
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 2 additions & 0 deletions api/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions api/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb337da

Please sign in to comment.