From f3a335782483b532e705e1178d056d1daadeb645 Mon Sep 17 00:00:00 2001 From: Janis Saldabols Date: Tue, 23 Jul 2024 11:37:50 +0300 Subject: [PATCH] PR-1821 Add default patron fee option --- src/main/java/org/folio/ncip/Constants.java | 8 +- .../java/org/folio/ncip/FolioNcipHelper.java | 7 +- .../folio/ncip/FolioRemoteServiceManager.java | 46 ++++++++++ src/test/java/org/folio/ncip/AcceptItem.java | 30 +++++++ src/test/java/org/folio/ncip/MockServer.java | 49 +++++++++- .../java/org/folio/ncip/NcipTestSuite.java | 2 +- .../resources/mockdata/accounts-post.json | 23 +++++ .../resources/mockdata/feeOwners-get.json | 16 ++++ src/test/resources/mockdata/feefines-get.json | 23 +++++ .../resources/mockdata/feefines-getEmpty.json | 10 +++ .../resources/mockdata/groups-getStaff.json | 12 +++ .../resources/mockdata/instances-post.json | 89 +++++++++++++++++++ src/test/resources/mockdata/items-post.json | 81 +++++++++++++++++ .../mockdata/ncip-acceptItem-blocked.xml | 43 +++++++++ .../resources/mockdata/ncip-acceptItem.xml | 7 ++ .../mockdata/usersByBarcode-get-blocked.json | 2 +- 16 files changed, 443 insertions(+), 5 deletions(-) create mode 100644 src/test/java/org/folio/ncip/AcceptItem.java create mode 100644 src/test/resources/mockdata/accounts-post.json create mode 100644 src/test/resources/mockdata/feeOwners-get.json create mode 100644 src/test/resources/mockdata/feefines-get.json create mode 100644 src/test/resources/mockdata/feefines-getEmpty.json create mode 100644 src/test/resources/mockdata/groups-getStaff.json create mode 100644 src/test/resources/mockdata/instances-post.json create mode 100644 src/test/resources/mockdata/items-post.json create mode 100644 src/test/resources/mockdata/ncip-acceptItem-blocked.xml diff --git a/src/main/java/org/folio/ncip/Constants.java b/src/main/java/org/folio/ncip/Constants.java index 78458e6..d2f4ac9 100644 --- a/src/main/java/org/folio/ncip/Constants.java +++ b/src/main/java/org/folio/ncip/Constants.java @@ -94,9 +94,15 @@ public class Constants { public static final String ITEM_SEARCH_BY_BARCODE_URL = "/inventory/items?limit=1&query=barcode%3D%3D%22$barcode$%22"; public static final String ADDRESS_TYPES = "/addresstypes"; public static final String PATRON_PIN_VERIFY = "/patron-pin/verify"; - + public static final String FEE_OWNER_URL = "/owners?query=owner=%22Reshare-ILL%22&limit=1"; + public static final String FEE_FINE_BY_OWNER_AND_TYPE = "/feefines?query=ownerId==$ownerId$%20and%20feeFineType=%22$feeType$%22&limit=1"; + public static final String PATRON_GROUP_BY_ID = "/groups/"; + public static final String ACCOUNT_URL = "/accounts"; public static final String DEFAULT_TIMEOUT = "30000"; public static final String SERVICE_MGR_TIMEOUT = "service_manager_timeout_ms"; + public static final String CHARGE_DEFAULT_PATRON_FEE = "charge-default-patron-fee"; + public static final String DEFAULT_PAYMENT_STATUS = "Outstanding"; + public static final String DEFAULT_FEE_STATUS = "Open"; } diff --git a/src/main/java/org/folio/ncip/FolioNcipHelper.java b/src/main/java/org/folio/ncip/FolioNcipHelper.java index fcf7981..351f5ef 100644 --- a/src/main/java/org/folio/ncip/FolioNcipHelper.java +++ b/src/main/java/org/folio/ncip/FolioNcipHelper.java @@ -26,6 +26,8 @@ import org.extensiblecatalog.ncip.v2.common.Translator; import org.extensiblecatalog.ncip.v2.common.TranslatorFactory; import org.extensiblecatalog.ncip.v2.service.BibliographicRecordIdentifierCode; +import org.extensiblecatalog.ncip.v2.service.FiscalActionType; +import org.extensiblecatalog.ncip.v2.service.FiscalTransactionType; import org.extensiblecatalog.ncip.v2.service.LocationType; import org.extensiblecatalog.ncip.v2.service.NCIPInitiationData; import org.extensiblecatalog.ncip.v2.service.NCIPResponseData; @@ -98,12 +100,15 @@ private Future initToolkitDefaults() { private void setUpMapping(){ SchemeValuePair.allowNullScheme(RequestType.class.getName(), RequestScopeType.class.getName(), - BibliographicRecordIdentifierCode.class.getName(), LocationType.class.getName(), PickupLocation.class.getName()); + BibliographicRecordIdentifierCode.class.getName(), LocationType.class.getName(), PickupLocation.class.getName(), + FiscalActionType.class.getName(), FiscalTransactionType.class.getName()); SchemeValuePair.mapBehavior(RequestType.class.getName(), SchemeValueBehavior.ALLOW_ANY); SchemeValuePair.mapBehavior(RequestScopeType.class.getName(), SchemeValueBehavior.ALLOW_ANY); SchemeValuePair.mapBehavior(BibliographicRecordIdentifierCode.class.getName(), SchemeValueBehavior.ALLOW_ANY); SchemeValuePair.mapBehavior(LocationType.class.getName(), SchemeValueBehavior.ALLOW_ANY); SchemeValuePair.mapBehavior(PickupLocation.class.getName(), SchemeValueBehavior.ALLOW_ANY); + SchemeValuePair.mapBehavior(FiscalActionType.class.getName(), SchemeValueBehavior.ALLOW_ANY); + SchemeValuePair.mapBehavior(FiscalTransactionType.class.getName(), SchemeValueBehavior.ALLOW_ANY); } public InputStream ncipProcess(RoutingContext context) throws Exception { diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index 2ba7d23..16a80d1 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -564,6 +564,8 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S returnValues.mergeIn(new JsonObject(requestRespone)).put("item", new JsonObject(itemResponse)) .put("holdings", new JsonObject(holdingsResponse)); + + addDefaultPatronFee(initData, user.getString("id"), user.getString("patronGroup"), baseUrl); } catch (Exception e) { // IF ANY OF THE ABOVE FAILED - ATTEMPT TO DELETE THE INSTANCE, HOLDINGS ITEM // THAT MAY HAVE BEEN CREATED ALONG THE WAY @@ -573,6 +575,50 @@ public JsonObject acceptItem(AcceptItemInitiationData initData, UserId userId, S return returnValues; } + protected void addDefaultPatronFee(AcceptItemInitiationData initData, String userId, String patronGroupId, String baseUrl) throws Exception { + if (initData.getFiscalTransactionInformation() != null && initData.getFiscalTransactionInformation().getFiscalActionType() != null && + Constants.CHARGE_DEFAULT_PATRON_FEE.equalsIgnoreCase(initData.getFiscalTransactionInformation().getFiscalActionType().getValue())) { + try { + JsonObject owner = new JsonObject(callApiGet(baseUrl + Constants.FEE_OWNER_URL)); + JsonArray ownersArray = owner.getJsonArray("owners"); + if (ownersArray.isEmpty()) { + throw new FolioNcipException("Failed to find fee owner Reshare-ILL"); + } + String ownerId = ownersArray.getJsonObject(0).getString("id"); + String patronGroup = new JsonObject(callApiGet(baseUrl + Constants.PATRON_GROUP_BY_ID + patronGroupId)) + .getString("group"); + if (patronGroup == null) { + throw new FolioNcipException("Failed to find patron group " + patronGroupId); + } + JsonObject fees = new JsonObject(callApiGet(baseUrl + Constants.FEE_FINE_BY_OWNER_AND_TYPE + .replace("$ownerId$", ownerId).replace("$feeType$", patronGroup))); + if (fees.getJsonArray("feefines").isEmpty()) { + throw new FolioNcipException("Failed to find fee type " + patronGroup); + } + JsonObject fee = fees.getJsonArray("feefines").getJsonObject(0); + JsonObject charge = new JsonObject(); + charge.put("ownerId", ownerId); + charge.put("feeFineId", fee.getString("id")); + charge.put("amount", fee.getValue("defaultAmount")); + JsonObject paymentStatus = new JsonObject(); + paymentStatus.put("name", Constants.DEFAULT_PAYMENT_STATUS); + charge.put("paymentStatus", paymentStatus); + JsonObject status = new JsonObject(); + status.put("name", Constants.DEFAULT_FEE_STATUS); + charge.put("status", status); + charge.put("remaining", fee.getValue("defaultAmount")); + charge.put("feeFineType", fee.getString("feeFineType")); + charge.put("feeFineOwner", ownersArray.getJsonObject(0).getString("owner")); + charge.put("userId", userId); + charge.put("id", UUID.randomUUID().toString()); + callApiPost(baseUrl + Constants.ACCOUNT_URL, charge); + } catch (Exception e) { + logger.error("Failed to add default patron fee", e); + throw e; + } + } + } + private void deleteItemAndRelatedRecords(String baseUrl, String instanceUuid, String holdingsUuid, String itemUuid){ String deleteInstanceUrl = baseUrl + Constants.INSTANCE_URL + "/" + instanceUuid; String deleteHoldingsUrl = baseUrl + Constants.HOLDINGS_URL + "/" + holdingsUuid; diff --git a/src/test/java/org/folio/ncip/AcceptItem.java b/src/test/java/org/folio/ncip/AcceptItem.java new file mode 100644 index 0000000..2c03654 --- /dev/null +++ b/src/test/java/org/folio/ncip/AcceptItem.java @@ -0,0 +1,30 @@ +package org.folio.ncip; + +import io.restassured.response.Response; +import org.junit.Test; + +import java.net.MalformedURLException; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +public class AcceptItem extends TestBase { + + private static final String REQUEST_ID = "de627598-d468-41e0-a849-450940478477"; + @Test + public void acceptItem() throws MalformedURLException { + Response response = postData("src/test/resources/mockdata/ncip-acceptItem.xml"); + String body = response.getBody().prettyPrint(); + assertEquals(200, response.getStatusCode()); + assertTrue(body.contains(REQUEST_ID)); + } + + @Test + public void acceptItemFailFee() throws MalformedURLException { + Response response = postData("src/test/resources/mockdata/ncip-acceptItem-blocked.xml"); + String body = response.getBody().prettyPrint(); + assertEquals(200, response.getStatusCode()); + assertTrue(body.contains("Problem performing AcceptItem")); + } + +} diff --git a/src/test/java/org/folio/ncip/MockServer.java b/src/test/java/org/folio/ncip/MockServer.java index 718df8c..1faac23 100644 --- a/src/test/java/org/folio/ncip/MockServer.java +++ b/src/test/java/org/folio/ncip/MockServer.java @@ -109,8 +109,11 @@ private Router defineRoutes() { router.get("/configurations/entries/toolkit").handler(this::getToolkitCofigs); router.get("/configurations/entries").handler(this::getNcipConfigs); router.get("/inventory/items").handler(this::items); + router.post("/inventory/items").handler(this::itemsPost); router.get("/inventory/instances").handler(this::instances); + router.post("/inventory/instances").handler(this::instancePost); router.get("/holdings-storage/holdings/:id").handler(this::holdingsById); + router.post("/holdings-storage/holdings").handler(this::holdingsById); router.post("/circulation/requests").handler(this::requestsPost); router.get("/addresstypes").handler(this::addressTypes); router.get("/instance-types").handler(this::instanceTypes); @@ -124,6 +127,9 @@ private Router defineRoutes() { router.get("/circulation/requests").handler(this::getCirculationRequestList); router.put("/circulation/requests/:id").handler(this::putCirculationRequestById); router.post("/patron-pin/verify").handler(this::verifyPing); + router.get("/owners").handler(this::getFeeOwner); + router.get("/feefines").handler(this::findFee); + router.post("/accounts").handler(this::postAccounts); return router; } @@ -153,7 +159,12 @@ private void getToolkitCofigs(RoutingContext ctx) { } private void groupLookup(RoutingContext ctx) { - String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "groups-get.json"; + String mockFileName; + if (ctx.request().path().contains("dac3aab4-7a86-422b-b5fc-6fbf7afd7aea")) { + mockFileName = TestConstants.PATH_TO_MOCK_FILES + "groups-getStaff.json"; + } else { + mockFileName = TestConstants.PATH_TO_MOCK_FILES + "groups-get.json"; + } String body = readLineByLine(mockFileName); serverResponse(ctx, 200, APPLICATION_JSON, body); } @@ -195,12 +206,24 @@ private void items(RoutingContext ctx) { serverResponse(ctx, 200, APPLICATION_JSON, body); } + private void itemsPost(RoutingContext ctx) { + String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "items-post.json"; + String body = readLineByLine(mockFileName); + serverResponse(ctx, 200, APPLICATION_JSON, body); + } + private void instances(RoutingContext ctx) { String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "instancesByHrid-get.json"; String body = readLineByLine(mockFileName); serverResponse(ctx, 200, APPLICATION_JSON, body); } + private void instancePost(RoutingContext ctx) { + String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "instances-post.json"; + String body = readLineByLine(mockFileName); + serverResponse(ctx, 200, APPLICATION_JSON, body); + } + private void holdingsById(RoutingContext ctx) { String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "holdingsById-get.json"; String body = readLineByLine(mockFileName); @@ -291,6 +314,30 @@ private void verifyPing(RoutingContext ctx) { .end(); } + private void getFeeOwner(RoutingContext ctx) { + String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "feeOwners-get.json"; + String body = readLineByLine(mockFileName); + serverResponse(ctx, 200, APPLICATION_JSON, body); + } + + private void findFee(RoutingContext ctx) { + String query = ctx.request().getParam("query"); + String mockFileName; + if (query.contains("staff")) { + mockFileName = TestConstants.PATH_TO_MOCK_FILES + "feefines-getEmpty.json"; + } else { + mockFileName = TestConstants.PATH_TO_MOCK_FILES + "feefines-get.json"; + } + String body = readLineByLine(mockFileName); + serverResponse(ctx, 200, APPLICATION_JSON, body); + } + + private void postAccounts(RoutingContext ctx) { + String mockFileName = TestConstants.PATH_TO_MOCK_FILES + "accounts-post.json"; + String body = readLineByLine(mockFileName); + serverResponse(ctx, 200, APPLICATION_JSON, body); + } + private void serverResponse(RoutingContext ctx, int statusCode, String contentType, String body) { ctx.response() .setStatusCode(statusCode) diff --git a/src/test/java/org/folio/ncip/NcipTestSuite.java b/src/test/java/org/folio/ncip/NcipTestSuite.java index a0eb295..d1bab42 100644 --- a/src/test/java/org/folio/ncip/NcipTestSuite.java +++ b/src/test/java/org/folio/ncip/NcipTestSuite.java @@ -14,7 +14,7 @@ @RunWith(Suite.class) @Suite.SuiteClasses({ - LookupUser.class, RequestItem.class, CancelRequestItem.class, DeleteItem.class + LookupUser.class, RequestItem.class, CancelRequestItem.class, DeleteItem.class, AcceptItem.class }) public class NcipTestSuite { diff --git a/src/test/resources/mockdata/accounts-post.json b/src/test/resources/mockdata/accounts-post.json new file mode 100644 index 0000000..e46e8e7 --- /dev/null +++ b/src/test/resources/mockdata/accounts-post.json @@ -0,0 +1,23 @@ +{ + "amount": 5.0, + "remaining": 5.0, + "status": { + "name": "Open" + }, + "paymentStatus": { + "name": "Outstanding" + }, + "feeFineType": "staff", + "feeFineOwner": "Reshare-ILL", + "metadata": { + "createdDate": "2024-07-23T07:35:12.492+00:00", + "createdByUserId": "7d265701-9b80-5501-bc85-0758b4667022", + "updatedDate": "2024-07-23T07:35:12.492+00:00", + "updatedByUserId": "7d265701-9b80-5501-bc85-0758b4667022" + }, + "userId": "d4a845bd-a326-4916-9cb4-6a5ac1a86155", + "feeFineId": "00fb288d-207a-4caa-9538-d18989367fbc", + "ownerId": "fe2307cf-6f39-4b2e-bb37-7668a2b5accf", + "id": "628e0831-30b0-415f-8b21-944950624926", + "contributors": [] +} \ No newline at end of file diff --git a/src/test/resources/mockdata/feeOwners-get.json b/src/test/resources/mockdata/feeOwners-get.json new file mode 100644 index 0000000..3e8c2fc --- /dev/null +++ b/src/test/resources/mockdata/feeOwners-get.json @@ -0,0 +1,16 @@ +{ + "owners": [ + { + "owner": "Reshare-ILL", + "servicePointOwner": [], + "metadata": { + "createdDate": "2024-07-19T10:08:41.016+00:00", + "createdByUserId": "7d265701-9b80-5501-bc85-0758b4667022", + "updatedDate": "2024-07-19T10:10:48.414+00:00", + "updatedByUserId": "7d265701-9b80-5501-bc85-0758b4667022" + }, + "id": "fe2307cf-6f39-4b2e-bb37-7668a2b5accf" + } + ], + "totalRecords": 1 +} \ No newline at end of file diff --git a/src/test/resources/mockdata/feefines-get.json b/src/test/resources/mockdata/feefines-get.json new file mode 100644 index 0000000..06c0fe3 --- /dev/null +++ b/src/test/resources/mockdata/feefines-get.json @@ -0,0 +1,23 @@ +{ + "feefines": [ + { + "automatic": false, + "feeFineType": "staff", + "defaultAmount": 5.0, + "ownerId": "fe2307cf-6f39-4b2e-bb37-7668a2b5accf", + "metadata": { + "createdDate": "2024-07-19T10:11:07.117+00:00", + "createdByUserId": "7d265701-9b80-5501-bc85-0758b4667022", + "updatedDate": "2024-07-19T10:11:07.117+00:00", + "updatedByUserId": "7d265701-9b80-5501-bc85-0758b4667022" + }, + "id": "00fb288d-207a-4caa-9538-d18989367fbc" + } + ], + "totalRecords": 1, + "resultInfo": { + "totalRecords": 1, + "facets": [], + "diagnostics": [] + } +} \ No newline at end of file diff --git a/src/test/resources/mockdata/feefines-getEmpty.json b/src/test/resources/mockdata/feefines-getEmpty.json new file mode 100644 index 0000000..b856739 --- /dev/null +++ b/src/test/resources/mockdata/feefines-getEmpty.json @@ -0,0 +1,10 @@ +{ + "feefines": [ + ], + "totalRecords": 0, + "resultInfo": { + "totalRecords": 0, + "facets": [], + "diagnostics": [] + } +} \ No newline at end of file diff --git a/src/test/resources/mockdata/groups-getStaff.json b/src/test/resources/mockdata/groups-getStaff.json new file mode 100644 index 0000000..f06afe4 --- /dev/null +++ b/src/test/resources/mockdata/groups-getStaff.json @@ -0,0 +1,12 @@ +{ + "group": "staff", + "desc": "Staff Member", + "id": "3684a786-6671-4268-8ed0-9db82ebca60b", + "expirationOffsetInDays": 730, + "metadata": { + "createdDate": "2024-03-13T00:03:41.447+00:00", + "createdByUserId": "15a65190-1f3e-5dd7-bbd7-a203d6e85a89", + "updatedDate": "2024-05-16T14:06:48.906+00:00", + "updatedByUserId": "15a65190-1f3e-5dd7-bbd7-a203d6e85a89" + } +} \ No newline at end of file diff --git a/src/test/resources/mockdata/instances-post.json b/src/test/resources/mockdata/instances-post.json new file mode 100644 index 0000000..660e13c --- /dev/null +++ b/src/test/resources/mockdata/instances-post.json @@ -0,0 +1,89 @@ +{ + "id": "5b1eb450-ff9f-412d-a9e7-887f6eaeb5b4", + "_version": "1", + "hrid": "inst000000000010", + "source": "FOLIO", + "title": "Concepts of fashion 1921 - 1987 microform a study of garments worn by selected winners of the Miss America Pageant Marian Ann J. Matwiejczyk-Montgomery", + "administrativeNotes": [], + "parentInstances": [], + "childInstances": [], + "isBoundWith": false, + "alternativeTitles": [], + "editions": [], + "series": [], + "identifiers": [ + { + "identifierTypeId": "5d164f4b-0b15-4e42-ae75-cfcf85318ad9", + "value": "1008673218" + }, + { + "identifierTypeId": "7e591197-f335-4afb-bc6d-a6d76ca3bace", + "value": "(DE-599)GBV1008673218" + } + ], + "contributors": [ + { + "authorityId": null, + "contributorNameTypeId": "2b94c631-fca9-4892-a730-03ee529ffe2a", + "name": "Matwiejczyk-Montgomery, Marian Ann J", + "contributorTypeId": null, + "contributorTypeText": null, + "primary": null + } + ], + "subjects": [ + { + "authorityId": null, + "value": "Hochschulschrift" + } + ], + "classifications": [], + "publication": [ + { + "publisher": "University Microfims International", + "place": "Ann Arbor, MI", + "dateOfPublication": "1993", + "role": null + } + ], + "publicationFrequency": [], + "publicationRange": [], + "electronicAccess": [], + "instanceTypeId": "6312d172-f0cf-40f6-b27d-9fa8feaf332f", + "instanceFormatIds": [], + "physicalDescriptions": [], + "languages": [ + "eng" + ], + "notes": [ + { + "instanceNoteTypeId": null, + "note": "Dissertation New York University 1993", + "staffOnly": false + }, + { + "instanceNoteTypeId": "6a2533a7-4de2-4e64-8466-074c2fa9308c", + "note": "Mikrofiche-Ausgabe", + "staffOnly": false + } + ], + "previouslyHeld": false, + "discoverySuppress": false, + "statisticalCodeIds": [], + "statusUpdatedDate": "2024-05-16T14:06:53.398+0000", + "metadata": { + "createdDate": "2024-05-16T14:06:53.398+00:00", + "createdByUserId": "15a65190-1f3e-5dd7-bbd7-a203d6e85a89", + "updatedDate": "2024-05-16T14:06:53.398+00:00", + "updatedByUserId": "15a65190-1f3e-5dd7-bbd7-a203d6e85a89" + }, + "tags": { + "tagList": [] + }, + "natureOfContentTermIds": [], + "publicationPeriod": { + "start": 1993 + }, + "precedingTitles": [], + "succeedingTitles": [] +} \ No newline at end of file diff --git a/src/test/resources/mockdata/items-post.json b/src/test/resources/mockdata/items-post.json new file mode 100644 index 0000000..bce2e8b --- /dev/null +++ b/src/test/resources/mockdata/items-post.json @@ -0,0 +1,81 @@ +{ + "id": "7212ba6a-8dcf-45a1-be9a-ffaa847c4423", + "_version": "20", + "status": { + "name": "Checked out", + "date": "2024-05-03T08:16:00.829+00:00" + }, + "administrativeNotes": [], + "title": "A semantic web primer", + "callNumber": "TK5105.88815 . A58 2004 FT MEADE", + "hrid": "item000000000014", + "contributorNames": [ + { + "name": "Antoniou, Grigoris" + }, + { + "name": "Van Harmelen, Frank" + } + ], + "formerIds": [], + "discoverySuppress": null, + "holdingsRecordId": "e3ff6133-b9a2-4d4c-a1c9-dc1867d4df19", + "barcode": "10101", + "itemLevelCallNumber": "TK5105.88815 . A58 2004 FT MEADE", + "enumeration": "", + "chronology": "", + "copyNumber": "Copy 2", + "notes": [], + "circulationNotes": [], + "tags": { + "tagList": [] + }, + "yearCaption": [], + "electronicAccess": [ + { + "uri": "http://www.loc.gov/catdir/toc/ecip0718/2007020429.html", + "linkText": "Links available", + "materialsSpecification": "Table of contents", + "publicNote": "Table of contents only", + "relationshipId": "3b430592-2e09-4b48-9a0c-0636d66b9fb3" + } + ], + "statisticalCodeIds": [ + "b5968c9e-cddc-4576-99e3-8e60aed8b0dd" + ], + "purchaseOrderLineIdentifier": null, + "materialType": { + "id": "5ee11d91-f7e8-481d-b079-65d708582ccc", + "name": "dvd" + }, + "permanentLoanType": { + "id": "2b94c631-fca9-4892-a730-03ee529ffe27", + "name": "Can circulate" + }, + "permanentLocation": { + "id": "fcd64ce1-6995-48f0-840e-89ffa2288371", + "name": "Main Library" + }, + "metadata": { + "createdDate": "2023-04-11T03:29:37.819+00:00", + "updatedDate": "2024-05-03T08:16:00.826+00:00", + "updatedByUserId": "2adad92c-82ac-5790-8ca6-c7ecb68f8474" + }, + "lastCheckIn": { + "servicePointId": "7c5abc9f-f3d7-4856-b8d7-6712462ca007", + "staffMemberId": "2adad92c-82ac-5790-8ca6-c7ecb68f8474", + "dateTime": "2024-05-03T05:18:20.007Z" + }, + "effectiveCallNumberComponents": { + "callNumber": "TK5105.88815 . A58 2004 FT MEADE", + "prefix": null, + "suffix": null, + "typeId": "512173a7-bd09-490e-b773-17d83f2b63fe" + }, + "effectiveShelvingOrder": "TK5105.88815 . A58 2004 FT MEADE Copy 2", + "isBoundWith": false, + "effectiveLocation": { + "id": "fcd64ce1-6995-48f0-840e-89ffa2288371", + "name": "Main Library" + } +} diff --git a/src/test/resources/mockdata/ncip-acceptItem-blocked.xml b/src/test/resources/mockdata/ncip-acceptItem-blocked.xml new file mode 100644 index 0000000..7656abb --- /dev/null +++ b/src/test/resources/mockdata/ncip-acceptItem-blocked.xml @@ -0,0 +1,43 @@ + +xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' + + + + Relais + + + LEHI + + + + Relais + LEH-20191003227 + + Hold For Pickup + + LEH + 5551213 + + + LEH + LEH-20191003227 + + + + Author + TEST ONE + + + Call Number + + + DELIVERY + + charge-default-patron-fee + ILL-fee + + 0 + + + + \ No newline at end of file diff --git a/src/test/resources/mockdata/ncip-acceptItem.xml b/src/test/resources/mockdata/ncip-acceptItem.xml index 8be21b1..d45222f 100644 --- a/src/test/resources/mockdata/ncip-acceptItem.xml +++ b/src/test/resources/mockdata/ncip-acceptItem.xml @@ -32,5 +32,12 @@ DELIVERY + + charge-default-patron-fee + ILL-fee + + 0 + + \ No newline at end of file diff --git a/src/test/resources/mockdata/usersByBarcode-get-blocked.json b/src/test/resources/mockdata/usersByBarcode-get-blocked.json index d1fad75..fe66458 100644 --- a/src/test/resources/mockdata/usersByBarcode-get-blocked.json +++ b/src/test/resources/mockdata/usersByBarcode-get-blocked.json @@ -5,7 +5,7 @@ "barcode" : "5551213", "active" : true, "type" : "patron", - "patronGroup" : "dac3aab4-7a86-422b-b5fc-6fbf7afd7aeb", + "patronGroup" : "dac3aab4-7a86-422b-b5fc-6fbf7afd7aea", "meta" : { "creation_date" : "2016-11-05T0723", "last_login_date" : ""