From 3cff830fb9fb7e3f1df69ddb69649769ee77251f Mon Sep 17 00:00:00 2001 From: Vignesh-Kalyanasundaram Date: Wed, 16 Oct 2024 11:37:03 +0530 Subject: [PATCH] EDGPATRON-149 Adding new endpoint to fetch patron details based on emailId --- ramls/edge-patron.raml | 90 +++++++++---------- .../org/folio/edge/patron/MainVerticle.java | 2 +- .../edge/patron/utils/PatronOkapiClient.java | 2 +- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/ramls/edge-patron.raml b/ramls/edge-patron.raml index 592dd19..f4fb318 100644 --- a/ramls/edge-patron.raml +++ b/ramls/edge-patron.raml @@ -622,50 +622,50 @@ types: body: text/plain: example: internal server error, contact administrator -/patron-registration-status/{emailId}: - uriParameters: - emailId: - description: The email ID of the patron. - type: string - required: true - get: - description: Get the patron details by email ID - queryParameters: - apikey: - description: "API Key" + /registration-status/{emailId}: + uriParameters: + emailId: + description: The email ID of the patron. type: string - responses: - 200: - description: patron information retrieved successfully - body: - application/json: - type: user - example: !include examples/user.json - 400: - description: Validation error - body: - application/json: - type: user_error_400 - example: !include examples/user_error.json - 401: - description: Not authorized to perform requested action - body: - text/plain: - example: unable to get account -- unauthorized - 403: - description: Access Denied - body: - text/plain: - example: Access Denied - 404: - description: Validation error - body: - application/json: - type: user_error_404 - example: !include examples/user_error.json - 500: - description: Internal server error, e.g. due to misconfiguration - body: - text/plain: - example: internal server error, contact administrator + required: true + get: + description: Get the patron details by email ID + queryParameters: + apikey: + description: "API Key" + type: string + responses: + 200: + description: patron information retrieved successfully + body: + application/json: + type: user + example: !include examples/user.json + 400: + description: Validation error + body: + application/json: + type: user_error_400 + example: !include examples/user_error.json + 401: + description: Not authorized to perform requested action + body: + text/plain: + example: unable to get account -- unauthorized + 403: + description: Access Denied + body: + text/plain: + example: Access Denied + 404: + description: Validation error + body: + application/json: + type: user_error_404 + example: !include examples/user_error.json + 500: + description: Internal server error, e.g. due to misconfiguration + body: + text/plain: + example: internal server error, contact administrator diff --git a/src/main/java/org/folio/edge/patron/MainVerticle.java b/src/main/java/org/folio/edge/patron/MainVerticle.java index cbbd01f..91252bb 100644 --- a/src/main/java/org/folio/edge/patron/MainVerticle.java +++ b/src/main/java/org/folio/edge/patron/MainVerticle.java @@ -84,7 +84,7 @@ public Router defineRoutes() { router.route(HttpMethod.POST, "/patron/account/:patronId/hold/:holdId/cancel") .handler(patronHandler::handleCancelHold); - router.route(HttpMethod.GET, "/patron-registration-status/:emailId") + router.route(HttpMethod.GET, "/patron/registration-status/:emailId") .handler(patronHandler::handleGetPatronRegistrationStatus); return router; diff --git a/src/main/java/org/folio/edge/patron/utils/PatronOkapiClient.java b/src/main/java/org/folio/edge/patron/utils/PatronOkapiClient.java index 160125c..11d8324 100644 --- a/src/main/java/org/folio/edge/patron/utils/PatronOkapiClient.java +++ b/src/main/java/org/folio/edge/patron/utils/PatronOkapiClient.java @@ -97,7 +97,7 @@ public void getAccount(String patronId, boolean includeLoans, boolean includeCha public void getExtPatronAccountByEmail(String email, Handler> responseHandler, Handler exceptionHandler) { - String url = String.format("%s/patron/account/by-email/%s", okapiURL, email); + String url = String.format("%s/patron/account/registration-status/%s", okapiURL, email); get( url, tenant,