Skip to content

Commit

Permalink
MODNCIP-68 Send field only if not null
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisSaldabols committed Sep 12, 2024
1 parent 9716aab commit afebb0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/main/java/org/folio/ncip/FolioRemoteServiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,12 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S
item.put(Constants.ID, itemUuid.toString());
item.put("holdingsRecordId", holdingsUuid.toString());
item.put("discoverySuppress", true);
item.put("itemLevelCallNumber", itemId.getItemIdentifierValue());
if (initData.getItemOptionalFields() != null && initData.getItemOptionalFields().getItemDescription() != null &&
initData.getItemOptionalFields().getItemDescription().getCallNumber() != null) {
item.put("itemLevelCallNumber", initData.getItemOptionalFields().getItemDescription().getCallNumber());
} else {
item.put("itemLevelCallNumber", 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
5 changes: 1 addition & 4 deletions src/test/resources/mockdata/ncip-acceptItem-blocked.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
<BibliographicDescription>
<Author>Author</Author>
<Title>TEST ONE</Title>
</BibliographicDescription>
<ItemDescription>
<CallNumber>Call Number</CallNumber>
</ItemDescription>
</BibliographicDescription>
</ItemOptionalFields>
<PickupLocation>DELIVERY</PickupLocation>
<FiscalTransactionInformation>
Expand Down

0 comments on commit afebb0a

Please sign in to comment.