From 6cc15b2c2f818baa8e82f3c35c6b1261899eb7a1 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 12 Nov 2024 12:38:37 +0200 Subject: [PATCH 1/8] PR-2026 Change request fulfillment preference configurable --- README.md | 46 ++++++++++--------- .../folio/ncip/FolioRemoteServiceManager.java | 4 +- src/main/resources/ncip.properties | 2 + 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 844638c..fa07deb 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ NISO Circulation Interchange Protocol (NCIP) support in FOLIO * (18) request.note.name Request note name. Default value "ILL note" * (19) request.note.enabled Request note enabled. Will add ILL request ID to loan and ILS request. Default value `false` * (20) item.soft.delete DeleteItem will use soft delete or delete entities. Default value `true` + * (21) request.fulfillment_preference ILS request fulfillment preference when RequestItem. Default value `Hold Shelf` + * (22) request.accept.fulfillment_preference ILS request fulfillment preference when AcceptItem. Default value `Hold Shelf` Notes * You can assign different values to these settings per Agency ID used in the NCIP requests. This approach lets you setup different values for different Agency IDs. For example, if Relais calls your NCIP server with the Agency ID of 'Relais' you can configure values for that agency. If ReShare calls your NCIP server using a different Agency ID, you can set up different configuration values to be used for ReShare requests. These settings have to exist for each Agency ID that will be used in the NCIP requests. @@ -139,27 +141,29 @@ There are three types of settings that can exist in mod-configuration for the NC #### NCIP Properties -| MODULE | configName (the AgencyID) | code | value (examples) | -|-----------|:-------------------------:|:-----------------------------------|-------------------:| -| NCIP | Relais | instance.type.name | RESHARE | -| NCIP | Relais | instance.source | RESHARE | -| NCIP | Relais | item.material.type.name | RESHARE | -| NCIP | Relais | item.perm.loan.type.name | RESHARE | -| NCIP | Relais | item.status.name | Available | -| NCIP | Relais | item.perm.location.code | RESHARE_DATALOGISK | -| NCIP | Relais | holdings.perm.location.code | RESHARE_DATALOGISK | -| NCIP | Relais | instance.custom.identifier.nam | ReShare Request ID | -| NCIP | Relais | checkout.service.point.code | online | -| NCIP | Relais | checkin.service.point.code | online | -| NCIP | Relais | response.includes.physical.address | false | -| NCIP | Relais | user.priv.ok.status | OK | -| NCIP | Relais | user.priv.blocked.status | BLOCKED | -| NCIP | Relais | cancel.request.reason.name | Item Not Available | -| NCIP | Relais | cancel.request.reason.patron.name | Item Not Available | -| NCIP | Relais | request.note.name | ILL note | -| NCIP | Relais | request.note.enabled | false | -| NCIP | Relais | item.soft.delete | true | -| NCIP | Relais | user.email.type | mailto | +| MODULE | configName (the AgencyID) | code | value (examples) | +|-----------|:-------------------------:|:--------------------------------------|-------------------:| +| NCIP | Relais | instance.type.name | RESHARE | +| NCIP | Relais | instance.source | RESHARE | +| NCIP | Relais | item.material.type.name | RESHARE | +| NCIP | Relais | item.perm.loan.type.name | RESHARE | +| NCIP | Relais | item.status.name | Available | +| NCIP | Relais | item.perm.location.code | RESHARE_DATALOGISK | +| NCIP | Relais | holdings.perm.location.code | RESHARE_DATALOGISK | +| NCIP | Relais | instance.custom.identifier.nam | ReShare Request ID | +| NCIP | Relais | checkout.service.point.code | online | +| NCIP | Relais | checkin.service.point.code | online | +| NCIP | Relais | response.includes.physical.address | false | +| NCIP | Relais | user.priv.ok.status | OK | +| NCIP | Relais | user.priv.blocked.status | BLOCKED | +| NCIP | Relais | cancel.request.reason.name | Item Not Available | +| NCIP | Relais | cancel.request.reason.patron.name | Item Not Available | +| NCIP | Relais | request.note.name | ILL note | +| NCIP | Relais | request.note.enabled | false | +| NCIP | Relais | item.soft.delete | true | +| NCIP | Relais | user.email.type | mailto | +| NCIP | Relais | request.fulfillment_preference | Hold Shelf | +| NCIP | Relais | request.accept.fulfillment_preference | Hold Shelf | You will need a set of these settings in mod-configuration for each individual Agency ID making NCIP requests. Example of an AgencyID in an NCIP request: diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index 228613d..b5bd9e8 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -572,7 +572,7 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S request.put("requestType", "Page"); // FOR EXPLAINATION ABOUT HARDCODE FULFILLMENT // SEE NOTES.TXT - request.put("fulfillmentPreference", "Hold Shelf"); + request.put("fulfillmentPreference", ncipProperties.getProperty(requesterAgencyId + ".request.accept.fulfillment_preference")); String uid = user.getString(Constants.ID); request.put("requesterId", uid); request.put("itemId", itemUuid.toString()); @@ -740,7 +740,7 @@ public JsonObject requestItem(RequestItemInitiationData initData) throws Excepti request.put(Constants.REQUEST_LEVEL, "Item"); } request.put("requestType", requestType); - request.put("fulfillmentPreference", "Delivery"); + request.put("fulfillmentPreference", ncipProperties.getProperty(agencyId + ".request.fulfillment_preference")); request.put("requesterId", user.getString(Constants.ID)); request.put("requestDate", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(ZonedDateTime.now())); String servicePointId; diff --git a/src/main/resources/ncip.properties b/src/main/resources/ncip.properties index b4029e6..0098b05 100644 --- a/src/main/resources/ncip.properties +++ b/src/main/resources/ncip.properties @@ -23,3 +23,5 @@ cancel.request.reason.patron.name=other request.note.name=General note request.note.enabled=false item.soft.delete=true +request.fulfillment_preference=Hold Shelf +request.accept.fulfillment_preference=Hold Shelf From ce69562ae4080dee87966ca45d2c8f23310a5c00 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 12 Nov 2024 15:13:51 +0200 Subject: [PATCH 2/8] PR-2041 Add option to configure loan info type --- README.md | 2 ++ src/main/java/org/folio/ncip/Constants.java | 1 - src/main/java/org/folio/ncip/FolioRemoteServiceManager.java | 2 +- src/main/resources/ncip.properties | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa07deb..be44c94 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ NISO Circulation Interchange Protocol (NCIP) support in FOLIO * (20) item.soft.delete DeleteItem will use soft delete or delete entities. Default value `true` * (21) request.fulfillment_preference ILS request fulfillment preference when RequestItem. Default value `Hold Shelf` * (22) request.accept.fulfillment_preference ILS request fulfillment preference when AcceptItem. Default value `Hold Shelf` + * (23) checkout.loan.info.type In checkout process if note is enabled then use this type to add info. Default value `patronInfoAdded` other possible value `staffInfoAdded` Notes * You can assign different values to these settings per Agency ID used in the NCIP requests. This approach lets you setup different values for different Agency IDs. For example, if Relais calls your NCIP server with the Agency ID of 'Relais' you can configure values for that agency. If ReShare calls your NCIP server using a different Agency ID, you can set up different configuration values to be used for ReShare requests. These settings have to exist for each Agency ID that will be used in the NCIP requests. @@ -164,6 +165,7 @@ There are three types of settings that can exist in mod-configuration for the NC | NCIP | Relais | user.email.type | mailto | | NCIP | Relais | request.fulfillment_preference | Hold Shelf | | NCIP | Relais | request.accept.fulfillment_preference | Hold Shelf | +| NCIP | Relais | checkout.loan.info.type | patronInfoAdded | You will need a set of these settings in mod-configuration for each individual Agency ID making NCIP requests. Example of an AgencyID in an NCIP request: diff --git a/src/main/java/org/folio/ncip/Constants.java b/src/main/java/org/folio/ncip/Constants.java index f324a77..68f982b 100644 --- a/src/main/java/org/folio/ncip/Constants.java +++ b/src/main/java/org/folio/ncip/Constants.java @@ -119,7 +119,6 @@ public class Constants { public static final String NOTE_DOMAIN_REQUESTS = "requests"; public static final String NOTE_TITLE_TEMPLATE = "ILL Request id: %s"; public static final String NOTE_LINK_TYPE_REQUEST = "request"; - public static final String STAFF_INFO_TYPE = "staffInfoAdded"; public static final String ITEM_STATUS_UNAVAILABLE = "Unavailable"; } diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index b5bd9e8..abeff35 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -451,7 +451,7 @@ private void addStaffInfoIfNeeded(String agencyId, RequestId requestId, String l if (Constants.BOOLEAN_TRUE.equalsIgnoreCase(noteEnabled) && requestId != null && requestId.getRequestIdentifierValue() != null) { JsonObject staffInfo = new JsonObject(); - staffInfo.put("action", Constants.STAFF_INFO_TYPE); + staffInfo.put("action", ncipProperties.getProperty(agencyId + ".checkout.loan.info.type")); staffInfo.put("actionComment", String.format(Constants.NOTE_TITLE_TEMPLATE, requestId.getRequestIdentifierValue())); try { callApiPost(baseUrl + String.format(Constants.ADD_STAFF_INFO_URL, loanUuid), staffInfo); diff --git a/src/main/resources/ncip.properties b/src/main/resources/ncip.properties index 0098b05..55c5298 100644 --- a/src/main/resources/ncip.properties +++ b/src/main/resources/ncip.properties @@ -25,3 +25,4 @@ request.note.enabled=false item.soft.delete=true request.fulfillment_preference=Hold Shelf request.accept.fulfillment_preference=Hold Shelf +checkout.loan.info.type=patronInfoAdded From d1d3c716637a69347b8dfd260b2d0b6336880360 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 12 Nov 2024 16:12:19 +0200 Subject: [PATCH 3/8] PR-2041 Add that it falls back to default value --- .../folio/ncip/FolioRemoteServiceManager.java | 55 ++++++++++--------- src/test/java/org/folio/ncip/MockServer.java | 13 +++-- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index abeff35..b241366 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -348,7 +348,7 @@ public JsonObject checkIn(CheckInItemInitiationData initData, String agencyId) t initProperties(agencyId, baseUrl); - String servicePoint = ncipProperties.getProperty(agencyId + ".checkin.service.point.id"); + String servicePoint = getProperty(agencyId,"checkin.service.point.id"); JsonObject jsonObject = new JsonObject(); jsonObject.put("servicePointId", servicePoint); @@ -409,7 +409,7 @@ public JsonObject checkOut(CheckOutItemInitiationData initData, String agencyId) initProperties(agencyId, baseUrl); - String servicePoint = ncipProperties.getProperty(agencyId + ".checkout.service.point.id"); + String servicePoint = getProperty(agencyId, "checkout.service.point.id"); JsonObject jsonObject = new JsonObject(); jsonObject.put("itemBarcode", itemBarcode); jsonObject.put("userBarcode", user.getString("barcode")); @@ -447,11 +447,11 @@ public JsonObject checkOut(CheckOutItemInitiationData initData, String agencyId) } private void addStaffInfoIfNeeded(String agencyId, RequestId requestId, String loanUuid, String baseUrl){ - String noteEnabled = ncipProperties.getProperty(agencyId + ".request.note.enabled"); + String noteEnabled = getProperty(agencyId, "request.note.enabled"); if (Constants.BOOLEAN_TRUE.equalsIgnoreCase(noteEnabled) && requestId != null && requestId.getRequestIdentifierValue() != null) { JsonObject staffInfo = new JsonObject(); - staffInfo.put("action", ncipProperties.getProperty(agencyId + ".checkout.loan.info.type")); + staffInfo.put("action", getProperty(agencyId, "checkout.loan.info.type")); staffInfo.put("actionComment", String.format(Constants.NOTE_TITLE_TEMPLATE, requestId.getRequestIdentifierValue())); try { callApiPost(baseUrl + String.format(Constants.ADD_STAFF_INFO_URL, loanUuid), staffInfo); @@ -511,13 +511,13 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S // BUILD INSTANCE JsonObject instance = new JsonObject(); instance.put(Constants.TITLE, retreiveItemTitle(initData)); - instance.put("instanceTypeId", ncipProperties.get(requesterAgencyId + ".instance.type.id")); + instance.put("instanceTypeId", getProperty(requesterAgencyId,"instance.type.id")); instance.put(Constants.ID, instanceUuid.toString()); - instance.put("source", ncipProperties.get(requesterAgencyId + ".instance.source")); + instance.put("source", getProperty(requesterAgencyId,"instance.source")); instance.put("discoverySuppress", true); JsonArray identifiersArray = new JsonArray(); JsonObject identifier = new JsonObject(); - identifier.put("identifierTypeId", ncipProperties.get(requesterAgencyId + ".instance.custom.identifier.id")); + identifier.put("identifierTypeId", getProperty(requesterAgencyId, "instance.custom.identifier.id")); identifier.put("value", initData.getRequestId().getRequestIdentifierValue()); identifiersArray.add(identifier); instance.put("identifiers", identifiersArray); @@ -529,9 +529,9 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S // CALL HOLDINGS API: JsonObject holdings = new JsonObject(); - String holdingsPermLocation = ncipProperties.getProperty(requesterAgencyId + ".holdings.perm.location.id"); + String holdingsPermLocation = getProperty(requesterAgencyId,"holdings.perm.location.id"); holdings.put(Constants.ID, holdingsUuid.toString()); - holdings.put("sourceId", ncipProperties.get(requesterAgencyId + ".holdings.source.id")); + holdings.put("sourceId", getProperty(requesterAgencyId, "holdings.source.id")); holdings.put("instanceId", instanceUuid.toString()); holdings.put("discoverySuppress", true); // REQUIRED, ELSE IT WILL NOT SHOW UP IN INVENTORY SEARCH BY LOCA. @@ -540,8 +540,8 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S String holdingsResponse = callApiPost(url, holdings); // CALL ITEMS API - String itemStatusName = ncipProperties.getProperty(requesterAgencyId + ".item.status.name"); - String itemLocation = ncipProperties.getProperty(requesterAgencyId + ".item.perm.location.id"); + String itemStatusName = getProperty(requesterAgencyId, "item.status.name"); + String itemLocation = getProperty(requesterAgencyId, "item.perm.location.id"); ItemId itemId = initData.getItemId(); JsonObject item = new JsonObject(); item.put(Constants.ID, itemUuid.toString()); @@ -552,11 +552,11 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S JsonObject permLocation = new JsonObject(); permLocation.put(Constants.ID, itemLocation); JsonObject materialType = new JsonObject(); - materialType.put(Constants.ID, ncipProperties.getProperty(requesterAgencyId + ".item.material.type.id")); + materialType.put(Constants.ID, getProperty(requesterAgencyId, "item.material.type.id")); JsonObject status = new JsonObject(); status.put("name", itemStatusName); JsonObject permLoanType = new JsonObject(); - permLoanType.put(Constants.ID, ncipProperties.getProperty(requesterAgencyId + ".item.perm.loan.type.id")); + permLoanType.put(Constants.ID, getProperty(requesterAgencyId, "item.perm.loan.type.id")); item.put(Constants.STATUS, status); item.put("materialType", materialType); @@ -572,7 +572,7 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S request.put("requestType", "Page"); // FOR EXPLAINATION ABOUT HARDCODE FULFILLMENT // SEE NOTES.TXT - request.put("fulfillmentPreference", ncipProperties.getProperty(requesterAgencyId + ".request.accept.fulfillment_preference")); + request.put("fulfillmentPreference", getProperty(requesterAgencyId, "request.accept.fulfillment_preference")); String uid = user.getString(Constants.ID); request.put("requesterId", uid); request.put("itemId", itemUuid.toString()); @@ -740,14 +740,14 @@ public JsonObject requestItem(RequestItemInitiationData initData) throws Excepti request.put(Constants.REQUEST_LEVEL, "Item"); } request.put("requestType", requestType); - request.put("fulfillmentPreference", ncipProperties.getProperty(agencyId + ".request.fulfillment_preference")); + request.put("fulfillmentPreference", getProperty(agencyId, "request.fulfillment_preference")); request.put("requesterId", user.getString(Constants.ID)); request.put("requestDate", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(ZonedDateTime.now())); String servicePointId; if (pickUpLocationCode != null) { servicePointId = getServicePointId(pickUpLocationCode, baseUrl); } else { - servicePointId = ncipProperties.getProperty(agencyId + ".checkout.service.point.id"); + servicePointId = getProperty(agencyId, "checkout.service.point.id"); } request.put("pickupServicePointId", servicePointId); request.put("itemLocationCode", locationCode); @@ -772,11 +772,11 @@ public JsonObject requestItem(RequestItemInitiationData initData) throws Excepti private void addNoteIfNeeded(String agencyId, String requestUuid, String illRequestId, String baseUrl) { try { - String noteEnabled = ncipProperties.getProperty(agencyId + ".request.note.enabled"); + String noteEnabled = getProperty(agencyId, "request.note.enabled"); if (Constants.BOOLEAN_TRUE.equalsIgnoreCase(noteEnabled)) { JsonObject note = new JsonObject(); note.put("domain", Constants.NOTE_DOMAIN_REQUESTS); - note.put("typeId", ncipProperties.getProperty(agencyId + ".request.note.id")); + note.put("typeId", getProperty(agencyId, "request.note.id")); note.put(Constants.TITLE, String.format(Constants.NOTE_TITLE_TEMPLATE, illRequestId)); JsonArray links = new JsonArray(); JsonObject link = new JsonObject(); @@ -916,10 +916,7 @@ private void initProperties(String requesterAgencyId, String baseUrl) throws Exc String returnArray = (String) setting.get("returnArray"); String identifier = (String) setting.get("identifier"); - String lookupValue = ncipProperties.getProperty(requesterAgencyId + "." + lookup); - - //IF THERE IS A DEFAULT VALUE FOR THE TENANT USE IT - if (lookupValue == null) lookupValue = ncipProperties.getProperty(lookup); + String lookupValue = getProperty(requesterAgencyId, lookup); if (lookupValue == null) throw new Exception("configuration value missing for " + requesterAgencyId + "." + lookup); @@ -1088,7 +1085,7 @@ public JsonObject cancelRequestItem(String requestId, UserId userId, String agen initProperties(agencyId, baseUrl); - String reasonId = ncipProperties.getProperty(agencyId + ".cancel.request.reason.id"); + String reasonId = getProperty(agencyId,"cancel.request.reason.id"); String url = baseUrl + Constants.REQUEST_URL + "/" + requestId; try { @@ -1137,7 +1134,7 @@ public void deleteItem(String itemId, String agencyId) throws Exception { JsonObject requestResponse = new JsonObject(requestResponseString); if (requestResponse.getInteger(Constants.TOTAL_RECORDS) > 0) { // Need to close open requests - String reasonId = ncipProperties.getProperty(agencyId + ".cancel.request.reason.patron.id"); + String reasonId = getProperty(agencyId, "cancel.request.reason.patron.id"); JsonArray requests = requestResponse.getJsonArray("requests"); requests.forEach(r -> { @@ -1155,7 +1152,7 @@ public void deleteItem(String itemId, String agencyId) throws Exception { }); } - String softDeleteEnabled = ncipProperties.getProperty(agencyId + ".item.soft.delete"); + String softDeleteEnabled = getProperty(agencyId, "item.soft.delete"); if (Constants.BOOLEAN_TRUE.equalsIgnoreCase(softDeleteEnabled)) { // Update item to Unavailable itemObject.getJsonObject(Constants.STATUS).put("name", Constants.ITEM_STATUS_UNAVAILABLE); @@ -1174,6 +1171,14 @@ public void deleteItem(String itemId, String agencyId) throws Exception { } } + private String getProperty(String agencyId, String key){ + String value = ncipProperties.getProperty(agencyId + "." + key); + if (value == null) { + value = ncipProperties.getProperty(key); + } + return value; + } + public JsonObject createUserFiscalTransaction(UserId userId, FiscalTransactionInformation fiscalTransactionInformation) throws Exception { try { String baseUrl = okapiHeaders.get(Constants.X_OKAPI_URL); diff --git a/src/test/java/org/folio/ncip/MockServer.java b/src/test/java/org/folio/ncip/MockServer.java index 24dc291..21b58ef 100644 --- a/src/test/java/org/folio/ncip/MockServer.java +++ b/src/test/java/org/folio/ncip/MockServer.java @@ -139,10 +139,15 @@ private void getNcipConfigs(RoutingContext ctx) { ctx.reroute("/configurations/entries/toolkit"); } - - String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "ncip-configs.json"; - String body = readLineByLine(mockFileName); - serverResponse(ctx, 200, APPLICATION_JSON, body); + if (param.contains("code==\"request.fulfillment_preference\"") || + param.contains("code==\"request.accept.fulfillment_preference\"") || + param.contains("code==\"checkout.loan.info.type\"")) { + serverResponse(ctx, 200, APPLICATION_JSON, "{\"configs\": []}"); + } else { + String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "ncip-configs.json"; + String body = readLineByLine(mockFileName); + serverResponse(ctx, 200, APPLICATION_JSON, body); + } } private void getToolkitCofigs(RoutingContext ctx) { From 20277efb1f947f2aed19b051fe9fe1fca81125c4 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 12 Nov 2024 16:38:21 +0200 Subject: [PATCH 4/8] Update NEWS.md file --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index a62787c..add0589 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +## 1.15.4 2024-11-12 +* Add new configuration options +* Make sure default values are used + ## 1.15.4 2024-11-11 * Update documentation * Clean configuration From 1c5b15277846868ef14f940fb7b7e2839c870832 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 12 Nov 2024 16:38:44 +0200 Subject: [PATCH 5/8] [maven-release-plugin] prepare release v1.15.5 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5bdde56..a81540c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.folio mod-ncip - 1.15.5-SNAPSHOT + 1.15.5 NCIP NCIP responder for FOLIO (internal module) @@ -224,7 +224,7 @@ https://github.com/folio-org/mod-ncip scm:git:git://github.com/folio-org/mod-ncip scm:git:git@github.com:folio-org/mod-ncip.git - HEAD + v1.15.5 From f5189f57ee32163e8d0d0bc44f976d46b880a8c1 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 12 Nov 2024 16:38:44 +0200 Subject: [PATCH 6/8] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a81540c..3906f37 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.folio mod-ncip - 1.15.5 + 1.15.6-SNAPSHOT NCIP NCIP responder for FOLIO (internal module) @@ -224,7 +224,7 @@ https://github.com/folio-org/mod-ncip scm:git:git://github.com/folio-org/mod-ncip scm:git:git@github.com:folio-org/mod-ncip.git - v1.15.5 + HEAD From 2c446c5f437fdb4cdc7859015a3d090ab388fdbe Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 12 Nov 2024 17:15:43 +0200 Subject: [PATCH 7/8] Add missing permission --- descriptors/ModuleDescriptor-template.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/descriptors/ModuleDescriptor-template.json b/descriptors/ModuleDescriptor-template.json index 010e352..664fd32 100644 --- a/descriptors/ModuleDescriptor-template.json +++ b/descriptors/ModuleDescriptor-template.json @@ -54,7 +54,8 @@ "accounts.item.post", "circulation.requests.item.get", "circulation.requests.item.put", - "note.types.collection.get" + "note.types.collection.get", + "circulation.loans.add-info.post" ] }, { From 8789ef5f166bba9530ce95a979f0cc4b3a77d058 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Wed, 20 Nov 2024 14:01:56 +0200 Subject: [PATCH 8/8] PR-2049 Use call number from accept item call when exists --- .../java/org/folio/ncip/FolioRemoteServiceManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index b241366..f7cd202 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -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); @@ -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);