From d460040aca9a6f978ec7ddae0534f1075ea9860e Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 13 Aug 2024 15:54:38 +0300 Subject: [PATCH] PR-1876 Add item ID to fee in barcode --- src/main/java/org/folio/ncip/FolioRemoteServiceManager.java | 4 ++++ .../resources/mockdata/ncip-createUserFiscalTransaction.xml | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index b5b9193..39d8253 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -613,6 +613,10 @@ protected JsonObject addDefaultPatronFee(FiscalTransactionInformation fiscalTran charge.put("feeFineOwner", ownersArray.getJsonObject(0).getString("owner")); charge.put("userId", userId); charge.put("id", UUID.randomUUID().toString()); + if (fiscalTransactionInformation.getItemDetails() != null && fiscalTransactionInformation.getItemDetails().getItemId() != null && + fiscalTransactionInformation.getItemDetails().getItemId().getItemIdentifierValue() != null) { + charge.put("barcode", fiscalTransactionInformation.getItemDetails().getItemId().getItemIdentifierValue()); + } return new JsonObject(callApiPost(baseUrl + Constants.ACCOUNT_URL, charge)); } catch (Exception e) { logger.error("Failed to add default patron fee", e); diff --git a/src/test/resources/mockdata/ncip-createUserFiscalTransaction.xml b/src/test/resources/mockdata/ncip-createUserFiscalTransaction.xml index 5f47074..f9b209b 100644 --- a/src/test/resources/mockdata/ncip-createUserFiscalTransaction.xml +++ b/src/test/resources/mockdata/ncip-createUserFiscalTransaction.xml @@ -19,6 +19,12 @@ 0 + + + i-123 + + + \ No newline at end of file