Skip to content

Commit

Permalink
PR-2049 Use call number from accept item call when exists
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisSaldabols committed Nov 20, 2024
1 parent 2c446c5 commit 8789ef5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/org/folio/ncip/FolioRemoteServiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S
throw new FolioNcipException(Constants.REQUEST_ID_MISSING);
}

String callNumber = null;
if (initData.getItemOptionalFields() != null && initData.getItemOptionalFields().getItemDescription() != null) {
callNumber = initData.getItemOptionalFields().getItemDescription().getCallNumber();
}

// VALIDATE PICKUP LOCATION
String pickUpLocationCode = initData.getPickupLocation().getValue();
String sPointId = getServicePointId(pickUpLocationCode, baseUrl);
Expand Down Expand Up @@ -547,7 +552,8 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S
item.put(Constants.ID, itemUuid.toString());
item.put(Constants.HOLDINGS_RECORD_ID, holdingsUuid.toString());
item.put("discoverySuppress", true);
item.put("itemLevelCallNumber", itemId.getItemIdentifierValue());

item.put("itemLevelCallNumber", StringUtils.isNotBlank(callNumber) ? callNumber : itemId.getItemIdentifierValue());
// PLACE HOLD DOES NOT WORK UNLESS THE ITEM HAS A PERM LOCATION
JsonObject permLocation = new JsonObject();
permLocation.put(Constants.ID, itemLocation);
Expand Down

0 comments on commit 8789ef5

Please sign in to comment.