Skip to content

Commit

Permalink
[EDGEPATRON-131]-Added POST edge api for LOC patron
Browse files Browse the repository at this point in the history
  • Loading branch information
SinghAdes committed Jun 10, 2024
1 parent 681e529 commit 479bbfe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/folio/edge/patron/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class Constants {
public static final String MSG_INTERNAL_SERVER_ERROR = "Internal Server Error";
public static final String MSG_REQUEST_TIMEOUT = "Request to FOLIO timed out";
public static final String MSG_HOLD_NOBODY = "No hold data provided";
public static final String MSG_EXTERNAL_NOBODY = "No external_patron data provided";

public static final String FIELD_EXPIRATION_DATE = "expirationDate";
public static final String FIELD_REQUEST_DATE = "requestDate";
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/folio/edge/patron/PatronHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import static org.folio.edge.patron.Constants.FIELD_EXPIRATION_DATE;
import static org.folio.edge.patron.Constants.FIELD_REQUEST_DATE;
import static org.folio.edge.patron.Constants.MSG_ACCESS_DENIED;
import static org.folio.edge.patron.Constants.MSG_EXTERNAL_NOBODY;
import static org.folio.edge.patron.Constants.MSG_HOLD_NOBODY;
import static org.folio.edge.patron.Constants.MSG_INTERNAL_SERVER_ERROR;
import static org.folio.edge.patron.Constants.MSG_REQUEST_TIMEOUT;
import static org.folio.edge.patron.Constants.MSG_HOLD_NOBODY;
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;
Expand Down Expand Up @@ -155,7 +156,7 @@ public void handlePlaceItemHold(RoutingContext ctx) {

public void handlePatronRequest(RoutingContext ctx) {
if (ctx.body().asJsonObject() == null) {
badRequest(ctx, MSG_HOLD_NOBODY);
badRequest(ctx, MSG_EXTERNAL_NOBODY);
return;
}
final String body = String.valueOf(ctx.body().asJsonObject());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.folio.edge.core.utils.test.MockOkapi;
import org.folio.edge.patron.model.*;
import org.folio.edge.patron.model.Account;
import org.folio.edge.patron.model.Charge;
import org.folio.edge.patron.model.Hold;
import org.folio.edge.patron.model.Hold.Status;

import com.fasterxml.jackson.core.JsonProcessingException;
Expand All @@ -42,6 +44,11 @@
import io.vertx.core.json.JsonObject;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
import org.folio.edge.patron.model.HoldCancellation;
import org.folio.edge.patron.model.Item;
import org.folio.edge.patron.model.Loan;
import org.folio.edge.patron.model.Money;
import org.folio.edge.patron.model.Patron;

public class PatronMockOkapi extends MockOkapi {

Expand Down

0 comments on commit 479bbfe

Please sign in to comment.