Skip to content

Commit

Permalink
Merge pull request #40 from indexdata/MODNCIP-68
Browse files Browse the repository at this point in the history
MODNCIP-68 Send field only if not null
  • Loading branch information
JanisSaldabols authored Sep 12, 2024
2 parents 09add9a + afebb0a commit f4ea723
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 f4ea723

Please sign in to comment.