-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EDGPATRON-161] - Extend get API for /patron/registration-status with…
… externalSystemId (#140) * [EDGPATRON-161] - Extend get API for /patron/registration-status with {externalSystemId} * [EDGPATRON-161] - Extend get API for /patron/registration-status with {externalSystemId}
- Loading branch information
1 parent
6f090f2
commit d01c9cc
Showing
6 changed files
with
77 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,7 @@ | |
import static org.folio.edge.core.Constants.DAY_IN_MILLIS; | ||
import static org.folio.edge.core.Constants.TEXT_PLAIN; | ||
import static org.folio.edge.core.Constants.X_OKAPI_TOKEN; | ||
import static org.folio.edge.patron.Constants.PARAM_EMAIL_ID; | ||
import static org.folio.edge.patron.Constants.PARAM_HOLD_ID; | ||
import static org.folio.edge.patron.Constants.PARAM_INCLUDE_CHARGES; | ||
import static org.folio.edge.patron.Constants.PARAM_INCLUDE_HOLDS; | ||
import static org.folio.edge.patron.Constants.PARAM_INCLUDE_LOANS; | ||
import static org.folio.edge.patron.Constants.PARAM_INSTANCE_ID; | ||
import static org.folio.edge.patron.Constants.PARAM_ITEM_ID; | ||
import static org.folio.edge.patron.Constants.PARAM_LIMIT; | ||
import static org.folio.edge.patron.Constants.PARAM_OFFSET; | ||
import static org.folio.edge.patron.Constants.PARAM_PATRON_ID; | ||
import static org.folio.edge.patron.Constants.PARAM_REQUEST_ID; | ||
import static org.folio.edge.patron.Constants.PARAM_SORT_BY; | ||
import static org.folio.edge.patron.Constants.*; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import io.vertx.core.http.HttpHeaders; | ||
|
@@ -277,22 +266,34 @@ public void getRegistrationStatusHandler(RoutingContext ctx) { | |
.setStatusCode(403) | ||
.putHeader(HttpHeaders.CONTENT_TYPE, TEXT_PLAIN) | ||
.end("Access requires permission: patron.account.get"); | ||
} else if(emailId.equals("[email protected]")) { | ||
} else if(emailId!=null && emailId.equals("[email protected]")) { | ||
ctx.response() | ||
.setStatusCode(200) | ||
.putHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON) | ||
.end(readMockFile("/user_active.json")); | ||
} else if(emailId.equals("[email protected]")) { | ||
} else if(emailId!=null && emailId.equals("9eb67301-6f6e-468f-9b1a-6134dc39a699")) { | ||
ctx.response() | ||
.setStatusCode(200) | ||
.putHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON) | ||
.end(readMockFile("/user_active.json")); | ||
} else if(emailId!=null && emailId.equals("[email protected]")) { | ||
ctx.response() | ||
.setStatusCode(400) | ||
.putHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON) | ||
.end(readMockFile("/multiple_user_error.json")); | ||
} else if(emailId.equals("[email protected]")) { | ||
} else if(emailId!=null && emailId.equals("[email protected]")) { | ||
ctx.response() | ||
.setStatusCode(404) | ||
.putHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON) | ||
.end(readMockFile("/user_not_found_error.json")); | ||
} | ||
else if(emailId!=null && emailId.equals("9eb67301-6f6e-468f-9b1a-6134dc39a700")) { | ||
ctx.response() | ||
.setStatusCode(404) | ||
.putHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON) | ||
.end(readMockFile("/user_not_found_error.json")); | ||
} else if(emailId.equals("[email protected]")) { | ||
} | ||
else if(emailId!=null && emailId.equals("[email protected]")) { | ||
ctx.response() | ||
.setStatusCode(404) | ||
.putHeader(HttpHeaders.CONTENT_TYPE, TEXT_PLAIN) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"id": "cacc29d8-cade-4312-a5f2-4eeac55d8697", | ||
"externalSystemId": "[email protected]", | ||
"externalSystemId": "9eb67301-6f6e-468f-9b1a-6134dc39a699", | ||
"active": true, | ||
"type": "patron", | ||
"patronGroup": "63f8065f-df84-4e76-a36b-3ba32dbdc9e5", | ||
|