From 32d3479557a4ea1c10c7b127c66cec404d815352 Mon Sep 17 00:00:00 2001 From: BKadirkhodjaev Date: Thu, 22 Aug 2024 18:57:39 +0500 Subject: [PATCH] [MODORDERS-1169]. Update tests, fix POL location bug, change API logger level --- .../java/org/folio/helper/CheckinHelper.java | 3 +- .../helper/CheckinReceivePiecesHelper.java | 18 +++--- .../folio/rest/impl/AcquisitionsUnitsApi.java | 20 +++---- .../folio/rest/impl/CompositePoLineAPI.java | 6 +- .../folio/rest/impl/HoldingsSummaryAPI.java | 2 +- .../folio/rest/impl/OrderTemplatesAPI.java | 10 ++-- .../java/org/folio/rest/impl/OrdersApi.java | 2 +- .../java/org/folio/rest/impl/PiecesAPI.java | 2 +- .../java/org/folio/rest/impl/PoNumberAPI.java | 2 +- .../org/folio/rest/impl/ReceivingAPI.java | 12 ++-- .../pieces/ItemRecreateInventoryService.java | 3 - .../rest/impl/CheckinReceivingApiTest.java | 58 +++++++++++++------ .../java/org/folio/rest/impl/MockServer.java | 17 ++++-- ...eceive-physical-resource-ecs-multiple.json | 14 +++-- ...-receive-physical-resource-ecs-single.json | 7 ++- .../consortium_purchase_order.json | 25 ++++++++ .../university_item_multiple_1.json | 24 ++++++++ .../university_item_multiple_2.json | 24 ++++++++ .../university_item_multiple_1.json | 28 --------- .../university_item_multiple_2.json | 28 --------- .../university_item_single.json | 28 --------- .../consortium_purchase_order.json | 25 ++++++++ .../university_item_single.json | 24 ++++++++ ...2bf2b04c-716a-4c08-bc48-831f5d1e6802.json} | 12 ++-- ...aae3a75a-4e12-4e60-8c14-605b31d7593b.json} | 25 +++++--- .../mockdata/lines/po_line_collection.json | 39 ++++++++----- ...-2bf2b04c-716a-4c08-bc48-831f5d1e6802.json | 22 +++++++ ...-94b00678-9df4-494a-9891-ebc7ccb76a48.json | 19 ------ ...-94b00678-9df4-494a-9891-ebc7ccb76a49.json | 33 ----------- ...-aae3a75a-4e12-4e60-8c14-605b31d7593b.json | 39 +++++++++++++ .../pieces/pieceRecordsCollection.json | 45 ++++++++------ .../resources/mockdata/titles/titles.json | 20 +++---- 32 files changed, 370 insertions(+), 266 deletions(-) create mode 100644 src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/consortium_purchase_order.json create mode 100644 src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/university_item_multiple_1.json create mode 100644 src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/university_item_multiple_2.json delete mode 100644 src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_multiple_1.json delete mode 100644 src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_multiple_2.json delete mode 100644 src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_single.json create mode 100644 src/test/resources/mockdata/ecs/b25f8ef6-04c4-4290-8531-9bbcefeb8c11/consortium_purchase_order.json create mode 100644 src/test/resources/mockdata/ecs/b25f8ef6-04c4-4290-8531-9bbcefeb8c11/university_item_single.json rename src/test/resources/mockdata/lines/{94b00678-9df4-494a-9891-ebc7ccb76a49.json => 2bf2b04c-716a-4c08-bc48-831f5d1e6802.json} (82%) rename src/test/resources/mockdata/lines/{94b00678-9df4-494a-9891-ebc7ccb76a48.json => aae3a75a-4e12-4e60-8c14-605b31d7593b.json} (67%) create mode 100644 src/test/resources/mockdata/pieces/pieceRecords-2bf2b04c-716a-4c08-bc48-831f5d1e6802.json delete mode 100644 src/test/resources/mockdata/pieces/pieceRecords-94b00678-9df4-494a-9891-ebc7ccb76a48.json delete mode 100644 src/test/resources/mockdata/pieces/pieceRecords-94b00678-9df4-494a-9891-ebc7ccb76a49.json create mode 100644 src/test/resources/mockdata/pieces/pieceRecords-aae3a75a-4e12-4e60-8c14-605b31d7593b.json diff --git a/src/main/java/org/folio/helper/CheckinHelper.java b/src/main/java/org/folio/helper/CheckinHelper.java index b81bf4c9b..59799e59a 100644 --- a/src/main/java/org/folio/helper/CheckinHelper.java +++ b/src/main/java/org/folio/helper/CheckinHelper.java @@ -98,8 +98,7 @@ private Future>> createItemsWithPieceUpdate(CheckinColle .map(PoLineCommonUtil::convertToCompositePoLine) .compose(compPol -> purchaseOrderStorageService.getPurchaseOrderByIdAsJson(compPol.getPurchaseOrderId(), requestContext) .map(HelperUtils::convertToCompositePurchaseOrder) - .compose(purchaseOrder -> pieceCreateFlowInventoryManager.processInventory(purchaseOrder, compPol, piece, - checkInPiece.getCreateItem(), requestContext)) + .compose(purchaseOrder -> pieceCreateFlowInventoryManager.processInventory(purchaseOrder, compPol, piece, checkInPiece.getCreateItem(), requestContext)) .map(voidResult -> new PiecesHolder.PiecePoLineDto(poLineId, piece)))); } else if (checkInPiece.getId().equals(piece.getId()) && InventoryUtils.allowItemRecreate(srcTenantId, dstTenantId) && Objects.nonNull(piece.getItemId())) { pieceFutures.add(purchaseOrderLineService.getOrderLineById(poLineId, requestContext) diff --git a/src/main/java/org/folio/helper/CheckinReceivePiecesHelper.java b/src/main/java/org/folio/helper/CheckinReceivePiecesHelper.java index 9134c89da..77e18e0be 100644 --- a/src/main/java/org/folio/helper/CheckinReceivePiecesHelper.java +++ b/src/main/java/org/folio/helper/CheckinReceivePiecesHelper.java @@ -2,7 +2,6 @@ import io.vertx.core.Context; import io.vertx.core.Future; -import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; import one.util.streamex.EntryStream; import one.util.streamex.StreamEx; @@ -362,6 +361,9 @@ private PoLine updateRelatedPoLineDetails(PoLine poLine, return poLine; } + + short updatedLocations = 0; + var compositePoLine = PoLineCommonUtil.convertToCompositePoLine(poLine); for (Piece pieceToUpdate : successfullyProcessed) { Optional relatedStoragePiece = piecesFromStorage.stream() .filter(piece -> piece.getId().equals(pieceToUpdate.getId())) @@ -369,17 +371,15 @@ private PoLine updateRelatedPoLineDetails(PoLine poLine, if (relatedStoragePiece.isEmpty()) { continue; } - CompositePoLine compositePoLine = PoLineCommonUtil.convertToCompositePoLine(poLine); PieceUpdateHolder holder = new PieceUpdateHolder(); holder.withPieceFromStorage(relatedStoragePiece.get()); holder.withPieceToUpdate(pieceToUpdate); holder.withPoLineOnly(compositePoLine); pieceUpdateFlowPoLineService.updatePoLineWithoutSave(holder); - - return HelperUtils.convertToPoLine(compositePoLine); + updatedLocations++; } - return poLine; + return updatedLocations > 0 ? HelperUtils.convertToPoLine(compositePoLine) : poLine; } /** @@ -623,7 +623,9 @@ private Future createHoldingsForChangedLocations(Piece piece, String in return Future.succeededFuture(true); } + // Get the initial tenant on the piece from storage String srcTenantId = piece.getReceivingTenantId(); + // Get the new tenant from the CheckInPiece object coming from the UI String dstTenantId = getReceivingTenantId(piece); Location location = new Location().withLocationId(getLocationId(piece)).withHoldingId(getHoldingId(piece)); RequestContext locationContext = RequestContextUtil.createContextWithNewTenantId(requestContext, dstTenantId); @@ -631,6 +633,8 @@ private Future createHoldingsForChangedLocations(Piece piece, String in srcTenantId, dstTenantId, location.getLocationId(), location.getHoldingId()); return inventoryInstanceManager.createShadowInstanceIfNeeded(instanceId, locationContext) .compose(instance -> { + // Does not create a holding for every piece so will be + // called conditionally only for cases without an affiliation change if (Objects.isNull(srcTenantId) || (srcTenantId.equals(dstTenantId))) { return inventoryHoldingManager.getOrCreateHoldingsRecord(instanceId, location, locationContext); } @@ -789,8 +793,8 @@ private String buildProcessedHoldingKey(Piece piece, String instanceId) { String locationId = getLocationId(piece); String holdingId = getHoldingId(piece); String receivingTenantId = getReceivingTenantId(piece); - // In case of affiliation change current holding is irrelevant because we will create a new holding in the - // destination tenant, so we need to block the creation of instances per affiliation-changed piece here + // In case of affiliation change current holding is irrelevant because we will create a new holding in the + // another tenant, so we need to block the creation of instances per affiliation-changed piece here if (Objects.nonNull(receivingTenantId)) { return receivingTenantId + instanceId; } else { diff --git a/src/main/java/org/folio/rest/impl/AcquisitionsUnitsApi.java b/src/main/java/org/folio/rest/impl/AcquisitionsUnitsApi.java index 109aab3a1..48c27450a 100644 --- a/src/main/java/org/folio/rest/impl/AcquisitionsUnitsApi.java +++ b/src/main/java/org/folio/rest/impl/AcquisitionsUnitsApi.java @@ -48,7 +48,7 @@ public void postAcquisitionsUnitsUnits(AcquisitionsUnit entity, Map { if (logger.isInfoEnabled()) { - logger.info("Successfully created new acquisitions unit: {} ", JsonObject.mapFrom(unit).encodePrettily()); + logger.debug("Successfully created new acquisitions unit: {} ", JsonObject.mapFrom(unit).encodePrettily()); } asyncResultHandler.handle(succeededFuture(buildResponseWithLocation( okapiHeaders.get(OKAPI_URL), resourceByIdPath(ACQUISITIONS_UNITS, unit.getId()), unit))); @@ -64,7 +64,7 @@ public void getAcquisitionsUnitsUnits(String query, String totalRecords, int off acquisitionsUnitsService.getAcquisitionsUnits(query, offset, limit, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(units -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved acquisitions units: {}", JsonObject.mapFrom(units).encodePrettily()); + logger.debug("Successfully retrieved acquisitions units: {}", JsonObject.mapFrom(units).encodePrettily()); } asyncResultHandler.handle(succeededFuture(buildOkResponse(units))); }) @@ -82,7 +82,7 @@ public void putAcquisitionsUnitsUnitsById(String id, AcquisitionsUnit entity, Ma } else { acquisitionsUnitsService.updateAcquisitionsUnit(entity.withId(id), new RequestContext(vertxContext, okapiHeaders)) .onSuccess(units -> { - logger.info("Successfully updated acquisitions unit with id={}", id); + logger.debug("Successfully updated acquisitions unit with id={}", id); asyncResultHandler.handle(succeededFuture(buildNoContentResponse())); }) .onFailure(t -> handleErrorResponse(asyncResultHandler, t)); @@ -97,7 +97,7 @@ public void getAcquisitionsUnitsUnitsById(String id, Map okapiHe acquisitionsUnitsService.getAcquisitionsUnit(id, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(unit -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved acquisitions unit: {}", JsonObject.mapFrom(unit).encodePrettily()); + logger.debug("Successfully retrieved acquisitions unit: {}", JsonObject.mapFrom(unit).encodePrettily()); } asyncResultHandler.handle(succeededFuture(buildOkResponse(unit))); }) @@ -112,7 +112,7 @@ public void deleteAcquisitionsUnitsUnitsById(String id, Map okap acquisitionsUnitsService.deleteAcquisitionsUnit(id, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(ok -> { if (logger.isInfoEnabled()) { - logger.info("Successfully deleted acquisitions unit with id={}", id); + logger.debug("Successfully deleted acquisitions unit with id={}", id); } asyncResultHandler.handle(succeededFuture(buildNoContentResponse())); }) @@ -127,7 +127,7 @@ public void postAcquisitionsUnitsMemberships(AcquisitionsUnitMembership entity, acquisitionsUnitsService.createAcquisitionsUnitsMembership(entity, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(membership -> { if (logger.isInfoEnabled()) { - logger.info("Successfully created new acquisitions units membership: {}", JsonObject.mapFrom(membership).encodePrettily()); + logger.debug("Successfully created new acquisitions units membership: {}", JsonObject.mapFrom(membership).encodePrettily()); } asyncResultHandler.handle( succeededFuture(buildResponseWithLocation(okapiHeaders.get(OKAPI_URL), resourceByIdPath(ACQUISITIONS_MEMBERSHIPS, membership.getId()), membership))); @@ -142,7 +142,7 @@ public void getAcquisitionsUnitsMemberships(String query, String totalRecords, i acquisitionsUnitsService.getAcquisitionsUnitsMemberships(query, offset, limit, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(memberships -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved acquisitions units memberships: {}", JsonObject.mapFrom(memberships).encodePrettily()); + logger.debug("Successfully retrieved acquisitions units memberships: {}", JsonObject.mapFrom(memberships).encodePrettily()); } asyncResultHandler.handle(succeededFuture(buildOkResponse(memberships))); }) @@ -158,7 +158,7 @@ public void putAcquisitionsUnitsMembershipsById(String id, AcquisitionsUnitMembe } else { acquisitionsUnitsService.updateAcquisitionsUnitsMembership(entity.withId(id), new RequestContext(vertxContext, okapiHeaders)) .onSuccess(membership -> { - logger.info("Successfully updated acquisitions units membership with id={}", id); + logger.debug("Successfully updated acquisitions units membership with id={}", id); asyncResultHandler.handle(succeededFuture(buildNoContentResponse())); }) .onFailure(t -> handleErrorResponse(asyncResultHandler, t)); @@ -171,7 +171,7 @@ public void getAcquisitionsUnitsMembershipsById(String id, Map o acquisitionsUnitsService.getAcquisitionsUnitsMembership(id, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(membership -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved acquisitions units membership: {}", JsonObject.mapFrom(membership).encodePrettily()); + logger.debug("Successfully retrieved acquisitions units membership: {}", JsonObject.mapFrom(membership).encodePrettily()); } asyncResultHandler.handle(succeededFuture(buildOkResponse(membership))); }) @@ -185,7 +185,7 @@ public void deleteAcquisitionsUnitsMembershipsById(String id, Map { if (logger.isInfoEnabled()) { - logger.info("Successfully deleted acquisitions units membership with id={}", id); + logger.debug("Successfully deleted acquisitions units membership with id={}", id); } asyncResultHandler.handle(succeededFuture(buildNoContentResponse())); }) diff --git a/src/main/java/org/folio/rest/impl/CompositePoLineAPI.java b/src/main/java/org/folio/rest/impl/CompositePoLineAPI.java index 3900b1328..07ee1da03 100644 --- a/src/main/java/org/folio/rest/impl/CompositePoLineAPI.java +++ b/src/main/java/org/folio/rest/impl/CompositePoLineAPI.java @@ -85,11 +85,11 @@ public void postOrdersOrderLines(CompositePoLine poLine, Map oka @Validate public void getOrdersOrderLinesById(String lineId, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - logger.info("Started Invocation of POLine Request with id = {}", lineId); + logger.debug("Started Invocation of POLine Request with id = {}", lineId); helper.getCompositePoLine(lineId, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(poLine -> { if (logger.isInfoEnabled()) { - logger.info("Received PO Line Response: {}", JsonObject.mapFrom(poLine) + logger.debug("Received PO Line Response: {}", JsonObject.mapFrom(poLine) .encodePrettily()); } asyncResultHandler.handle(succeededFuture(buildOkResponse(poLine))); @@ -110,7 +110,7 @@ public void deleteOrdersOrderLinesById(String lineId, Map okapiH @Validate public void putOrdersOrderLinesById(String lineId, CompositePoLine poLine, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - logger.info("Handling PUT Order Line operation..."); + logger.debug("Handling PUT Order Line operation..."); // Set id if this is available only in path RequestContext requestContext = new RequestContext(vertxContext, okapiHeaders); if (StringUtils.isEmpty(poLine.getId())) { diff --git a/src/main/java/org/folio/rest/impl/HoldingsSummaryAPI.java b/src/main/java/org/folio/rest/impl/HoldingsSummaryAPI.java index 28432f7c1..bcecde51a 100644 --- a/src/main/java/org/folio/rest/impl/HoldingsSummaryAPI.java +++ b/src/main/java/org/folio/rest/impl/HoldingsSummaryAPI.java @@ -42,7 +42,7 @@ public void getOrdersHoldingSummaryById(String holdingId, Map ok holdingsSummaryService.getHoldingsSummary(holdingId, requestContext) .onSuccess(holdingSummary -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved : {}", JsonObject.mapFrom(holdingSummary).encodePrettily()); + logger.debug("Successfully retrieved : {}", JsonObject.mapFrom(holdingSummary).encodePrettily()); } asyncResultHandler.handle(succeededFuture(this.buildOkResponse(holdingSummary))); }) diff --git a/src/main/java/org/folio/rest/impl/OrderTemplatesAPI.java b/src/main/java/org/folio/rest/impl/OrderTemplatesAPI.java index c15804912..5ec5126d1 100644 --- a/src/main/java/org/folio/rest/impl/OrderTemplatesAPI.java +++ b/src/main/java/org/folio/rest/impl/OrderTemplatesAPI.java @@ -37,7 +37,7 @@ public void postOrdersOrderTemplates(OrderTemplate entity, Map o orderTemplatesHelper.createOrderTemplate(entity) .onSuccess(template -> { if (logger.isInfoEnabled()) { - logger.info("Successfully created new order template: {}", JsonObject.mapFrom(template) + logger.debug("Successfully created new order template: {}", JsonObject.mapFrom(template) .encodePrettily()); } asyncResultHandler.handle(succeededFuture( @@ -54,7 +54,7 @@ public void getOrdersOrderTemplates(String query, String totalRecords, int offse helper.getOrderTemplates(query, offset, limit) .onSuccess(templates -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved order templates collection: {}", JsonObject.mapFrom(templates).encodePrettily()); + logger.debug("Successfully retrieved order templates collection: {}", JsonObject.mapFrom(templates).encodePrettily()); } asyncResultHandler.handle(succeededFuture(helper.buildOkResponse(templates))); }) @@ -78,7 +78,7 @@ public void putOrdersOrderTemplatesById(String id, OrderTemplate entity, Map { - logger.info("Successfully updated order template with id={}", id); + logger.debug("Successfully updated order template with id={}", id); asyncResultHandler.handle(succeededFuture(helper.buildNoContentResponse())); }) .onFailure(t -> handlePostPutErrorResponse(asyncResultHandler, t, helper)); @@ -102,7 +102,7 @@ public void getOrdersOrderTemplatesById(String id, Map okapiHead helper.getOrderTemplateById(id) .onSuccess(template -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved order template: {}", JsonObject.mapFrom(template) + logger.debug("Successfully retrieved order template: {}", JsonObject.mapFrom(template) .encodePrettily()); } asyncResultHandler.handle(succeededFuture(helper.buildOkResponse(template))); @@ -118,7 +118,7 @@ public void deleteOrdersOrderTemplatesById(String id, Map okapiH helper.deleteOrderTemplate(id) .onSuccess(ok -> { if (logger.isInfoEnabled()) { - logger.info("Successfully deleted order template with id={}", id); + logger.debug("Successfully deleted order template with id={}", id); } asyncResultHandler.handle(succeededFuture(helper.buildNoContentResponse())); }) diff --git a/src/main/java/org/folio/rest/impl/OrdersApi.java b/src/main/java/org/folio/rest/impl/OrdersApi.java index 3897f0418..cd29dc5fc 100644 --- a/src/main/java/org/folio/rest/impl/OrdersApi.java +++ b/src/main/java/org/folio/rest/impl/OrdersApi.java @@ -97,7 +97,7 @@ public void getOrdersCompositeOrders(String totalRecords, int offset, int limit, .getPurchaseOrders(limit, offset, query, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(orders -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved orders: {}", JsonObject.mapFrom(orders).encodePrettily()); + logger.debug("Successfully retrieved orders: {}", JsonObject.mapFrom(orders).encodePrettily()); } asyncResultHandler.handle(succeededFuture(buildOkResponse(orders))); }) diff --git a/src/main/java/org/folio/rest/impl/PiecesAPI.java b/src/main/java/org/folio/rest/impl/PiecesAPI.java index f7f694a4b..550fd6176 100644 --- a/src/main/java/org/folio/rest/impl/PiecesAPI.java +++ b/src/main/java/org/folio/rest/impl/PiecesAPI.java @@ -63,7 +63,7 @@ public void postOrdersPieces(boolean createItem, Piece entity, Map { if (logger.isInfoEnabled()) { - logger.info("Successfully created piece: {}", JsonObject.mapFrom(piece) + logger.debug("Successfully created piece: {}", JsonObject.mapFrom(piece) .encodePrettily()); } asyncResultHandler.handle(succeededFuture(buildCreatedResponse(piece))); diff --git a/src/main/java/org/folio/rest/impl/PoNumberAPI.java b/src/main/java/org/folio/rest/impl/PoNumberAPI.java index 6b3850a1d..4512389f0 100644 --- a/src/main/java/org/folio/rest/impl/PoNumberAPI.java +++ b/src/main/java/org/folio/rest/impl/PoNumberAPI.java @@ -35,7 +35,7 @@ public PoNumberAPI() { @Validate public void getOrdersPoNumber(Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - logger.info("Receiving generated poNumber ..."); + logger.debug("Receiving generated poNumber ..."); poNumberHelper.getPoNumber(new RequestContext(vertxContext, okapiHeaders)) .onSuccess(result -> asyncResultHandler.handle(succeededFuture(buildOkResponse(result)))) diff --git a/src/main/java/org/folio/rest/impl/ReceivingAPI.java b/src/main/java/org/folio/rest/impl/ReceivingAPI.java index 6d6b62e81..453351c78 100644 --- a/src/main/java/org/folio/rest/impl/ReceivingAPI.java +++ b/src/main/java/org/folio/rest/impl/ReceivingAPI.java @@ -42,7 +42,7 @@ public class ReceivingAPI implements OrdersReceive, OrdersCheckIn, OrdersExpect, @Validate public void postOrdersReceive(ReceivingCollection entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - logger.info("Receiving {} items", entity.getTotalRecords()); + logger.debug("Receiving {} items", entity.getTotalRecords()); ReceivingHelper helper = new ReceivingHelper(entity, okapiHeaders, vertxContext); helper.receiveItems(entity, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(result -> asyncResultHandler.handle(succeededFuture(helper.buildOkResponse(result)))) @@ -53,7 +53,7 @@ public void postOrdersReceive(ReceivingCollection entity, Map ok @Validate public void postOrdersCheckIn(CheckinCollection entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - logger.info("Checkin {} items", entity.getTotalRecords()); + logger.debug("Checkin {} items", entity.getTotalRecords()); CheckinHelper helper = new CheckinHelper(entity, okapiHeaders, vertxContext); helper.checkinPieces(entity, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(result -> asyncResultHandler.handle(succeededFuture(helper.buildOkResponse(result)))) @@ -62,7 +62,7 @@ public void postOrdersCheckIn(CheckinCollection entity, Map okap @Override public void postOrdersExpect(ExpectCollection entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - logger.info("Expect {} pieces", entity.getTotalRecords()); + logger.debug("Expect {} pieces", entity.getTotalRecords()); ExpectHelper helper = new ExpectHelper(entity, okapiHeaders, vertxContext); helper.expectPieces(entity, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(result -> asyncResultHandler.handle(succeededFuture(helper.buildOkResponse(result)))) @@ -71,7 +71,7 @@ public void postOrdersExpect(ExpectCollection entity, Map okapiH @Override public void postOrdersBindPieces(BindPiecesCollection entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - logger.info("Bind {} pieces", entity.getBindPieceIds()); + logger.debug("Bind {} pieces", entity.getBindPieceIds()); validateRequiredFields(entity); BindHelper helper = new BindHelper(entity, okapiHeaders, vertxContext); helper.bindPieces(entity, new RequestContext(vertxContext, okapiHeaders)) @@ -81,7 +81,7 @@ public void postOrdersBindPieces(BindPiecesCollection entity, Map okapiHeaders, Handler> asyncResultHandler, Context vertxContext) { - logger.info("Removing binding for piece: {}", id); + logger.debug("Removing binding for piece: {}", id); BindHelper helper = new BindHelper(okapiHeaders, vertxContext); helper.removeBinding(id, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(s -> asyncResultHandler.handle(succeededFuture(helper.buildNoContentResponse()))) @@ -98,7 +98,7 @@ public void getOrdersReceivingHistory(String totalRecords, int offset, int limit helper.getReceivingHistory(limit, offset, query, new RequestContext(vertxContext, okapiHeaders)) .onSuccess(receivingHistory -> { if (logger.isInfoEnabled()) { - logger.info("Successfully retrieved receiving history: {} ", JsonObject.mapFrom(receivingHistory).encodePrettily()); + logger.debug("Successfully retrieved receiving history: {} ", JsonObject.mapFrom(receivingHistory).encodePrettily()); } asyncResultHandler.handle(succeededFuture(helper.buildOkResponse(receivingHistory))); }) diff --git a/src/main/java/org/folio/service/pieces/ItemRecreateInventoryService.java b/src/main/java/org/folio/service/pieces/ItemRecreateInventoryService.java index 3990ef57a..815a33b1b 100644 --- a/src/main/java/org/folio/service/pieces/ItemRecreateInventoryService.java +++ b/src/main/java/org/folio/service/pieces/ItemRecreateInventoryService.java @@ -9,8 +9,6 @@ import java.util.NoSuchElementException; import java.util.Optional; import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.folio.models.ItemStatus; import org.folio.rest.core.models.RequestContext; import org.folio.rest.jaxrs.model.CompositePoLine; @@ -22,7 +20,6 @@ public class ItemRecreateInventoryService { protected static final int ITEM_QUANTITY = 1; - private static final Logger logger = LogManager.getLogger(ItemRecreateInventoryService.class); private final InventoryItemManager inventoryItemManager; diff --git a/src/test/java/org/folio/rest/impl/CheckinReceivingApiTest.java b/src/test/java/org/folio/rest/impl/CheckinReceivingApiTest.java index ba216d0e6..3121555c7 100644 --- a/src/test/java/org/folio/rest/impl/CheckinReceivingApiTest.java +++ b/src/test/java/org/folio/rest/impl/CheckinReceivingApiTest.java @@ -28,6 +28,7 @@ import org.folio.rest.jaxrs.model.PoLine; import org.folio.rest.jaxrs.model.PoLineCollection; import org.folio.rest.jaxrs.model.ProcessingStatus; +import org.folio.rest.jaxrs.model.PurchaseOrder; import org.folio.rest.jaxrs.model.ReceivedItem; import org.folio.rest.jaxrs.model.ReceivingCollection; import org.folio.rest.jaxrs.model.ReceivingItemResult; @@ -106,6 +107,9 @@ import static org.folio.rest.core.exceptions.ErrorCodes.REQUESTS_ACTION_REQUIRED; import static org.folio.rest.core.exceptions.ErrorCodes.TITLE_NOT_FOUND; import static org.folio.rest.impl.MockServer.BASE_MOCK_DATA_PATH; +import static org.folio.rest.impl.MockServer.CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_MULTIPLE_ITEMS; +import static org.folio.rest.impl.MockServer.CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_SINGLE_ITEM; +import static org.folio.rest.impl.MockServer.ECS_CONSORTIUM_PURCHASE_ORDER_JSON; import static org.folio.rest.impl.MockServer.PIECE_RECORDS_MOCK_DATA_PATH; import static org.folio.rest.impl.MockServer.POLINES_COLLECTION; import static org.folio.rest.impl.MockServer.addMockEntry; @@ -700,18 +704,26 @@ void testPostCheckInPhysicalFullyReceivedWithChangedLocation() { private static Stream testPostCheckInPhysicalFullyReceivedEcsArgs() { return Stream.of( - Arguments.of(12, "checkin-fully-receive-physical-resource-ecs-single.json", 1, 4, 1), - Arguments.of(13, "checkin-fully-receive-physical-resource-ecs-multiple.json", 2, 5, 1) + Arguments.of(CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_SINGLE_ITEM, "checkin-fully-receive-physical-resource-ecs-single.json", 1, 4, 1, 1), + Arguments.of(CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_MULTIPLE_ITEMS, "checkin-fully-receive-physical-resource-ecs-multiple.json", 2, 5, 1, 2) ); } @ParameterizedTest @MethodSource("testPostCheckInPhysicalFullyReceivedEcsArgs") - void testPostCheckInPhysicalFullyReceivedEcs(int poLineIdx, String checkInCollectionPath, - int processedSuccessfullyCount, int polSearchesCount, int purchaseOrderSearchesCount) { + void testPostCheckInPhysicalFullyReceivedEcs(String orderId, String checkInCollectionPath, int processedCount, int poLineCount, int orderCount, int locationCount) throws IOException { logger.info("=== Test POST check-in - Check-in Fully Received physical resource with changed affiliation in a ECS environment ==="); - CompositePoLine compositePoLine = getMockAsJson(POLINES_COLLECTION).getJsonArray("poLines").getJsonObject(poLineIdx).mapTo(CompositePoLine.class); + PurchaseOrder purchaseOrder = new JsonObject(getMockData(String.format(ECS_CONSORTIUM_PURCHASE_ORDER_JSON, orderId))).mapTo(PurchaseOrder.class); + addMockEntry(PURCHASE_ORDER_STORAGE, purchaseOrder); + + CompositePoLine compositePoLine = getMockAsJson(POLINES_COLLECTION).getJsonArray("poLines") + .stream() + .map(json -> (JsonObject) json) + .filter(json -> json.getString("purchaseOrderId").equals(purchaseOrder.getId())) + .findFirst() + .orElseThrow() + .mapTo(CompositePoLine.class); MockServer.addMockTitles(Collections.singletonList(compositePoLine)); CheckinCollection checkinCollection = getMockAsJson(CHECKIN_RQ_MOCK_DATA_PATH + checkInCollectionPath).mapTo(CheckinCollection.class); @@ -719,12 +731,15 @@ void testPostCheckInPhysicalFullyReceivedEcs(int poLineIdx, String checkInCollec ReceivingResults results = verifyPostResponse(ORDERS_CHECKIN_ENDPOINT, JsonObject.mapFrom(checkinCollection).encode(), prepareHeaders(EXIST_CONFIG_X_OKAPI_TENANT_ECS), APPLICATION_JSON, 200).as(ReceivingResults.class); + // Added to make the test wait for POL batch update + MockServer.waitForUpdates(500); + assertThat(results.getTotalRecords(), equalTo(checkinCollection.getTotalRecords())); ReceivingResult receivingResult = results.getReceivingResults().get(0); assertThat(receivingResult.getPoLineId(), not(is(emptyString()))); - assertThat(receivingResult.getProcessedSuccessfully(), is(processedSuccessfullyCount)); + assertThat(receivingResult.getProcessedSuccessfully(), is(processedCount)); assertThat(receivingResult.getProcessedWithError(), is(0)); Map> pieceIdsByPol = verifyReceivingSuccessRs(results); @@ -748,8 +763,8 @@ void testPostCheckInPhysicalFullyReceivedEcs(int poLineIdx, String checkInCollec assertThat(pieceSearches, hasSize(expectedSearchRqQty + pieceIdsByPol.size())); assertThat(pieceUpdates, hasSize(checkinCollection.getTotalRecords())); // Should be >1 due to an extra call performed in CheckinHelper.createItemsWithPieceUpdate per CheckInPiece - assertThat(polSearches, hasSize(polSearchesCount)); - assertThat(purchaseOrderSearches, hasSize(purchaseOrderSearchesCount)); + assertThat(polSearches, hasSize(poLineCount)); + assertThat(purchaseOrderSearches, hasSize(orderCount)); assertThat(polBatchUpdates, hasSize(pieceIdsByPol.size())); JsonArray poLinesJson = polBatchUpdates.get(0).getJsonArray("poLines"); @@ -757,16 +772,23 @@ void testPostCheckInPhysicalFullyReceivedEcs(int poLineIdx, String checkInCollec PoLine poLineAfterReceive = poLinesJson.getJsonObject(i).mapTo(PoLine.class); logger.info("POL location before ECS checkIn: {}", JsonArray.of(compositePoLine.getLocations()).encodePrettily()); logger.info("POL location after ECS checkIn: {}", JsonArray.of(poLineAfterReceive.getLocations()).encodePrettily()); - Location oldLocation = compositePoLine.getLocations().get(0); - Location newLocation = poLineAfterReceive.getLocations().get(0); - assertThat(oldLocation.getLocationId(), nullValue()); - assertThat(newLocation.getLocationId(), nullValue()); - assertThat(oldLocation.getHoldingId(), not(nullValue())); - assertThat(newLocation.getHoldingId(), not(nullValue())); - assertThat(oldLocation.getTenantId(), is("university")); - assertThat(newLocation.getTenantId(), is("college")); - assertThat(oldLocation.getTenantId(), not(newLocation.getTenantId())); - assertThat(oldLocation.getHoldingId(), not(newLocation.getHoldingId())); + + assertThat(compositePoLine.getLocations().size(), is(locationCount)); + assertThat(poLineAfterReceive.getLocations().size(), is(locationCount)); + for (int j = 0; j < compositePoLine.getLocations().size(); j++) { + Location oldLocation = compositePoLine.getLocations().get(j); + Location newLocation = poLineAfterReceive.getLocations().get(j); + assertThat(oldLocation.getLocationId(), nullValue()); + assertThat(newLocation.getLocationId(), nullValue()); + assertThat(oldLocation.getHoldingId(), not(nullValue())); + assertThat(newLocation.getHoldingId(), not(nullValue())); + assertThat(oldLocation.getTenantId(), is("university")); + assertThat(newLocation.getTenantId(), is("college")); + assertThat(oldLocation.getTenantId(), not(newLocation.getTenantId())); + assertThat(oldLocation.getHoldingId(), not(newLocation.getHoldingId())); + assertThat(pieceUpdates.stream().anyMatch(piece -> piece.getString("holdingId").equals(newLocation.getHoldingId())), is(true)); + } + assertThat(poLineAfterReceive.getReceiptStatus(), is(PoLine.ReceiptStatus.FULLY_RECEIVED)); assertThat(poLineAfterReceive.getReceiptDate(), not(nullValue())); } diff --git a/src/test/java/org/folio/rest/impl/MockServer.java b/src/test/java/org/folio/rest/impl/MockServer.java index 5afbc32b6..8efc4b51a 100644 --- a/src/test/java/org/folio/rest/impl/MockServer.java +++ b/src/test/java/org/folio/rest/impl/MockServer.java @@ -326,7 +326,8 @@ public class MockServer { public static final String ORDER_ID_DUPLICATION_ERROR_USER_ID = "b711da5e-c84f-4cb3-9978-1d00500e7707"; public static final String CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL = "8137de83-76c0-4d3e-bf73-416de5e780fa"; public static final String CONSISTENT_ECS_PURCHASE_ORDER_ID_ELECTRONIC = "01c8d44a-dc73-4bca-a4d1-ef28bdfb9275"; - public static final String CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_CHECK_IN_PIECES = "1ab7ef6a-d1d4-4a4f-90a2-882aed18af14"; + public static final String CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_SINGLE_ITEM = "b25f8ef6-04c4-4290-8531-9bbcefeb8c11"; + public static final String CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_MULTIPLE_ITEMS = "0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c"; public static Table> serverRqRs = HashBasedTable.create(); public static HashMap> serverRqQueries = new HashMap<>(); @@ -1269,9 +1270,9 @@ private void handleGetInventoryItemRecords(RoutingContext ctx) { private static void appendEcsItems(JsonArray jsonArray) throws IOException { jsonArray.add(new JsonObject(getMockData(String.format(ECS_UNIVERSITY_ITEM_JSON, CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL)))); jsonArray.add(new JsonObject(getMockData(String.format(ECS_UNIVERSITY_ITEM_JSON, CONSISTENT_ECS_PURCHASE_ORDER_ID_ELECTRONIC)))); - jsonArray.add(new JsonObject(getMockData(String.format(ECS_UNIVERSITY_ITEM_SINGLE_JSON, CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_CHECK_IN_PIECES)))); - jsonArray.add(new JsonObject(getMockData(String.format(ECS_UNIVERSITY_ITEM_MULTIPLE_1_JSON, CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_CHECK_IN_PIECES)))); - jsonArray.add(new JsonObject(getMockData(String.format(ECS_UNIVERSITY_ITEM_MULTIPLE_2_JSON, CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_CHECK_IN_PIECES)))); + jsonArray.add(new JsonObject(getMockData(String.format(ECS_UNIVERSITY_ITEM_SINGLE_JSON, CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_SINGLE_ITEM)))); + jsonArray.add(new JsonObject(getMockData(String.format(ECS_UNIVERSITY_ITEM_MULTIPLE_1_JSON, CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_MULTIPLE_ITEMS)))); + jsonArray.add(new JsonObject(getMockData(String.format(ECS_UNIVERSITY_ITEM_MULTIPLE_2_JSON, CONSISTENT_ECS_PURCHASE_ORDER_ID_PHYSICAL_MULTIPLE_ITEMS)))); } private void handleGetInventoryItemRecordById(RoutingContext ctx) { @@ -3019,4 +3020,12 @@ private void handleGetOrganizations(RoutingContext ctx) { serverResponse(ctx, 404, APPLICATION_JSON, null); } } + + public static void waitForUpdates(long time) { + try { + Thread.sleep(time); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } } diff --git a/src/test/resources/mockdata/checkIn/checkin-fully-receive-physical-resource-ecs-multiple.json b/src/test/resources/mockdata/checkIn/checkin-fully-receive-physical-resource-ecs-multiple.json index 03c285aa4..faad1c756 100644 --- a/src/test/resources/mockdata/checkIn/checkin-fully-receive-physical-resource-ecs-multiple.json +++ b/src/test/resources/mockdata/checkIn/checkin-fully-receive-physical-resource-ecs-multiple.json @@ -1,24 +1,26 @@ { "toBeCheckedIn": [ { - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a49", + "poLineId": "aae3a75a-4e12-4e60-8c14-605b31d7593b", "checkedIn": 2, "checkInPieces": [ { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62cb", - "displaySummary": "Test 2-1", + "id": "a977c7e7-61c3-40ec-9e17-a23263646688", + "displaySummary": "2", "displayOnHolding": false, + "supplement": false, "receivingTenantId": "college", "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0", "holdingId": null, "itemStatus": "In process" }, { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62cc", - "displaySummary": "Test 2-2", + "id": "8853e1d5-b7db-4b01-a1cd-a0661e78fc50", + "displaySummary": "1", "displayOnHolding": false, + "supplement": false, "receivingTenantId": "college", - "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0", + "locationId": "f34d27c6-a8eb-461b-acd6-5dea81771e70", "holdingId": null, "itemStatus": "In process" } diff --git a/src/test/resources/mockdata/checkIn/checkin-fully-receive-physical-resource-ecs-single.json b/src/test/resources/mockdata/checkIn/checkin-fully-receive-physical-resource-ecs-single.json index f43779732..536baafd2 100644 --- a/src/test/resources/mockdata/checkIn/checkin-fully-receive-physical-resource-ecs-single.json +++ b/src/test/resources/mockdata/checkIn/checkin-fully-receive-physical-resource-ecs-single.json @@ -1,13 +1,14 @@ { "toBeCheckedIn": [ { - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a48", + "poLineId": "2bf2b04c-716a-4c08-bc48-831f5d1e6802", "checkedIn": 1, "checkInPieces": [ { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62ca", - "displaySummary": "Test 2-1", + "id": "eee55830-33bc-458d-81e6-a27211438adc", + "displaySummary": "1", "displayOnHolding": false, + "supplement": false, "receivingTenantId": "college", "locationId": "53cf956f-c1df-410b-8bea-27f712cca7c0", "holdingId": null, diff --git a/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/consortium_purchase_order.json b/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/consortium_purchase_order.json new file mode 100644 index 000000000..8a276f379 --- /dev/null +++ b/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/consortium_purchase_order.json @@ -0,0 +1,25 @@ +{ + "id": "0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c", + "tags": { + "tagList": [ + "amazon" + ] + }, + "notes": [ + "Check credit card statement to make sure payment shows up" + ], + "billTo": "5f8a321e-6b38-4d90-92d4-bf08f91a2242", + "shipTo": "f7c36792-05f7-4c8c-969d-103ac6763187", + "vendor": "e0fb5df2-cdf1-11e8-a8d5-f2801f1b9fd1", + "approved": true, + "manualPo": false, + "poNumber": "10002", + "template": "4dee318b-f5b3-40dc-be93-cc89b8c45b6f", + "orderType": "One-Time", + "acqUnitIds": [], + "reEncumber": false, + "dateOrdered": "2024-08-22T05:46:34.960+00:00", + "approvalDate": "2024-08-22T05:46:34.958+00:00", + "approvedById": "122b3d2b-4788-4f1e-9117-56daa91cb75c", + "workflowStatus": "Open" +} diff --git a/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/university_item_multiple_1.json b/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/university_item_multiple_1.json new file mode 100644 index 000000000..60bcac3f0 --- /dev/null +++ b/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/university_item_multiple_1.json @@ -0,0 +1,24 @@ +{ + "id": "400ffb07-3f43-4c08-9e54-6070a8aa446d", + "hrid": "it00000000001", + "notes": [], + "status": { + "date": "2024-08-22T05:46:38.213+00:00", + "name": "On order" + }, + "_version": 3, + "formerIds": [], + "yearCaption": [], + "displaySummary": "1", + "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", + "circulationNotes": [], + "electronicAccess": [], + "holdingsRecordId": "5afdf421-7b02-43d7-9d93-917d1724a725", + "discoverySuppress": false, + "statisticalCodeIds": [], + "administrativeNotes": [], + "effectiveLocationId": "fcd64ce1-6995-48f0-840e-89ffa2288371", + "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", + "purchaseOrderLineIdentifier": "aae3a75a-4e12-4e60-8c14-605b31d7593b", + "effectiveCallNumberComponents": {} +} diff --git a/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/university_item_multiple_2.json b/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/university_item_multiple_2.json new file mode 100644 index 000000000..c15703b28 --- /dev/null +++ b/src/test/resources/mockdata/ecs/0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c/university_item_multiple_2.json @@ -0,0 +1,24 @@ +{ + "id": "05b10ba2-adc1-4fe2-aa0f-8a05633d135b", + "hrid": "it00000000002", + "notes": [], + "status": { + "date": "2024-08-22T06:58:44.108+00:00", + "name": "On order" + }, + "_version": 1, + "formerIds": [], + "yearCaption": [], + "displaySummary": "2", + "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", + "circulationNotes": [], + "electronicAccess": [], + "holdingsRecordId": "82220193-de57-4c10-afb0-0529b5368ff0", + "discoverySuppress": false, + "statisticalCodeIds": [], + "administrativeNotes": [], + "effectiveLocationId": "184aae84-a5bf-4c6a-85ba-4a7c73026cd5", + "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", + "purchaseOrderLineIdentifier": "aae3a75a-4e12-4e60-8c14-605b31d7593b", + "effectiveCallNumberComponents": {} +} diff --git a/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_multiple_1.json b/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_multiple_1.json deleted file mode 100644 index 59e4879f6..000000000 --- a/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_multiple_1.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": "0efc2a06-d376-488e-8593-1a5c66fa8268", - "hrid": "it00000000008", - "notes": [], - "status": { - "date": "2024-08-15T06:49:19.286+00:00", - "name": "On order" - }, - "_version": 1, - "metadata": { - "createdDate": "2024-08-15T06:49:19.285Z", - "updatedDate": "2024-08-15T06:49:19.285Z", - "createdByUserId": "122b3d2b-4788-4f1e-9117-56daa91cb75c", - "updatedByUserId": "122b3d2b-4788-4f1e-9117-56daa91cb75c" - }, - "formerIds": [], - "yearCaption": [], - "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", - "circulationNotes": [], - "electronicAccess": [], - "holdingsRecordId": "46523917-e1c0-4cda-b0ad-84a90550cb73", - "statisticalCodeIds": [], - "administrativeNotes": [], - "effectiveLocationId": "fcd64ce1-6995-48f0-840e-89ffa2288371", - "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", - "purchaseOrderLineIdentifier": "94b00678-9df4-494a-9891-ebc7ccb76a48", - "effectiveCallNumberComponents": {} -} diff --git a/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_multiple_2.json b/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_multiple_2.json deleted file mode 100644 index 558efa6a7..000000000 --- a/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_multiple_2.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": "0efc2a06-d376-488e-8593-1a5c66fa8267", - "hrid": "it00000000008", - "notes": [], - "status": { - "date": "2024-08-15T06:49:19.286+00:00", - "name": "On order" - }, - "_version": 1, - "metadata": { - "createdDate": "2024-08-15T06:49:19.285Z", - "updatedDate": "2024-08-15T06:49:19.285Z", - "createdByUserId": "122b3d2b-4788-4f1e-9117-56daa91cb75c", - "updatedByUserId": "122b3d2b-4788-4f1e-9117-56daa91cb75c" - }, - "formerIds": [], - "yearCaption": [], - "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", - "circulationNotes": [], - "electronicAccess": [], - "holdingsRecordId": "46523917-e1c0-4cda-b0ad-84a90550cb73", - "statisticalCodeIds": [], - "administrativeNotes": [], - "effectiveLocationId": "fcd64ce1-6995-48f0-840e-89ffa2288371", - "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", - "purchaseOrderLineIdentifier": "94b00678-9df4-494a-9891-ebc7ccb76a48", - "effectiveCallNumberComponents": {} -} diff --git a/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_single.json b/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_single.json deleted file mode 100644 index 34d8d2e2b..000000000 --- a/src/test/resources/mockdata/ecs/1ab7ef6a-d1d4-4a4f-90a2-882aed18af14/university_item_single.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": "0efc2a06-d376-488e-8593-1a5c66fa8266", - "hrid": "it00000000008", - "notes": [], - "status": { - "date": "2024-08-15T06:49:19.286+00:00", - "name": "On order" - }, - "_version": 1, - "metadata": { - "createdDate": "2024-08-15T06:49:19.285Z", - "updatedDate": "2024-08-15T06:49:19.285Z", - "createdByUserId": "122b3d2b-4788-4f1e-9117-56daa91cb75c", - "updatedByUserId": "122b3d2b-4788-4f1e-9117-56daa91cb75c" - }, - "formerIds": [], - "yearCaption": [], - "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", - "circulationNotes": [], - "electronicAccess": [], - "holdingsRecordId": "46523917-e1c0-4cda-b0ad-84a90550cb73", - "statisticalCodeIds": [], - "administrativeNotes": [], - "effectiveLocationId": "fcd64ce1-6995-48f0-840e-89ffa2288371", - "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", - "purchaseOrderLineIdentifier": "94b00678-9df4-494a-9891-ebc7ccb76a48", - "effectiveCallNumberComponents": {} -} diff --git a/src/test/resources/mockdata/ecs/b25f8ef6-04c4-4290-8531-9bbcefeb8c11/consortium_purchase_order.json b/src/test/resources/mockdata/ecs/b25f8ef6-04c4-4290-8531-9bbcefeb8c11/consortium_purchase_order.json new file mode 100644 index 000000000..d59aeaa06 --- /dev/null +++ b/src/test/resources/mockdata/ecs/b25f8ef6-04c4-4290-8531-9bbcefeb8c11/consortium_purchase_order.json @@ -0,0 +1,25 @@ +{ + "id": "b25f8ef6-04c4-4290-8531-9bbcefeb8c11", + "tags": { + "tagList": [ + "amazon" + ] + }, + "notes": [ + "Check credit card statement to make sure payment shows up" + ], + "billTo": "5f8a321e-6b38-4d90-92d4-bf08f91a2242", + "shipTo": "f7c36792-05f7-4c8c-969d-103ac6763187", + "vendor": "e0fb5df2-cdf1-11e8-a8d5-f2801f1b9fd1", + "approved": true, + "manualPo": false, + "poNumber": "10004", + "template": "4dee318b-f5b3-40dc-be93-cc89b8c45b6f", + "orderType": "One-Time", + "acqUnitIds": [], + "reEncumber": false, + "dateOrdered": "2024-08-22T08:12:06.323+00:00", + "approvalDate": "2024-08-22T08:12:06.322+00:00", + "approvedById": "122b3d2b-4788-4f1e-9117-56daa91cb75c", + "workflowStatus": "Open" +} diff --git a/src/test/resources/mockdata/ecs/b25f8ef6-04c4-4290-8531-9bbcefeb8c11/university_item_single.json b/src/test/resources/mockdata/ecs/b25f8ef6-04c4-4290-8531-9bbcefeb8c11/university_item_single.json new file mode 100644 index 000000000..074039c29 --- /dev/null +++ b/src/test/resources/mockdata/ecs/b25f8ef6-04c4-4290-8531-9bbcefeb8c11/university_item_single.json @@ -0,0 +1,24 @@ +{ + "id": "74ad86a6-d5cb-4dbb-bb41-d8d0c389e89f", + "hrid": "it00000000003", + "notes": [], + "status": { + "date": "2024-08-22T08:12:11.357+00:00", + "name": "On order" + }, + "_version": 3, + "formerIds": [], + "yearCaption": [], + "displaySummary": "1", + "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", + "circulationNotes": [], + "electronicAccess": [], + "holdingsRecordId": "79b51935-de14-4715-b6de-3c3a8d749208", + "discoverySuppress": false, + "statisticalCodeIds": [], + "administrativeNotes": [], + "effectiveLocationId": "fcd64ce1-6995-48f0-840e-89ffa2288371", + "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", + "purchaseOrderLineIdentifier": "2bf2b04c-716a-4c08-bc48-831f5d1e6802", + "effectiveCallNumberComponents": {} +} diff --git a/src/test/resources/mockdata/lines/94b00678-9df4-494a-9891-ebc7ccb76a49.json b/src/test/resources/mockdata/lines/2bf2b04c-716a-4c08-bc48-831f5d1e6802.json similarity index 82% rename from src/test/resources/mockdata/lines/94b00678-9df4-494a-9891-ebc7ccb76a49.json rename to src/test/resources/mockdata/lines/2bf2b04c-716a-4c08-bc48-831f5d1e6802.json index 17c2e7e08..ac533934c 100644 --- a/src/test/resources/mockdata/lines/94b00678-9df4-494a-9891-ebc7ccb76a49.json +++ b/src/test/resources/mockdata/lines/2bf2b04c-716a-4c08-bc48-831f5d1e6802.json @@ -1,5 +1,5 @@ { - "id": "94b00678-9df4-494a-9891-ebc7ccb76a49", + "id": "2bf2b04c-716a-4c08-bc48-831f5d1e6802", "cost": { "currency": "USD", "discountType": "percentage", @@ -28,16 +28,16 @@ { "quantity": 1, "tenantId": "university", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", + "holdingId": "79b51935-de14-4715-b6de-3c3a8d749208", "quantityPhysical": 1 } ], "collection": false, - "instanceId": "e76fe67f-bea4-4bff-bfd3-2bc487417556", + "instanceId": "88fe2b5b-7c99-427e-9c8d-1647f5b0c502", "orderFormat": "Physical Resource", "checkinItems": false, "contributors": [], - "poLineNumber": "10008-1", + "poLineNumber": "10004-1", "vendorDetail": { "instructions": "", "vendorAccount": "1234", @@ -47,9 +47,9 @@ "receiptStatus": "Awaiting Receipt", "claimingActive": false, "reportingCodes": [], - "titleOrPackage": "Test 2", + "titleOrPackage": "1169-2", "automaticExport": false, - "purchaseOrderId": "1ab7ef6a-d1d4-4a4f-90a2-882aed18af14", + "purchaseOrderId": "b25f8ef6-04c4-4290-8531-9bbcefeb8c11", "claimingInterval": 45, "fundDistribution": [], "acquisitionMethod": "306489dd-0053-49ee-a068-c316444a8f55", diff --git a/src/test/resources/mockdata/lines/94b00678-9df4-494a-9891-ebc7ccb76a48.json b/src/test/resources/mockdata/lines/aae3a75a-4e12-4e60-8c14-605b31d7593b.json similarity index 67% rename from src/test/resources/mockdata/lines/94b00678-9df4-494a-9891-ebc7ccb76a48.json rename to src/test/resources/mockdata/lines/aae3a75a-4e12-4e60-8c14-605b31d7593b.json index b4bffbff4..83040fc85 100644 --- a/src/test/resources/mockdata/lines/94b00678-9df4-494a-9891-ebc7ccb76a48.json +++ b/src/test/resources/mockdata/lines/aae3a75a-4e12-4e60-8c14-605b31d7593b.json @@ -1,11 +1,11 @@ { - "id": "94b00678-9df4-494a-9891-ebc7ccb76a48", + "id": "aae3a75a-4e12-4e60-8c14-605b31d7593b", "cost": { "currency": "USD", "discountType": "percentage", "listUnitPrice": 1.0, - "quantityPhysical": 1, - "poLineEstimatedPrice": 1.0 + "quantityPhysical": 2, + "poLineEstimatedPrice": 2.0 }, "rush": false, "alerts": [], @@ -28,16 +28,22 @@ { "quantity": 1, "tenantId": "university", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", + "holdingId": "82220193-de57-4c10-afb0-0529b5368ff0", + "quantityPhysical": 1 + }, + { + "quantity": 1, + "tenantId": "university", + "holdingId": "5afdf421-7b02-43d7-9d93-917d1724a725", "quantityPhysical": 1 } ], "collection": false, - "instanceId": "e76fe67f-bea4-4bff-bfd3-2bc487417556", + "instanceId": "d97f0db3-7cb0-4179-bce0-1ad648aff60d", "orderFormat": "Physical Resource", "checkinItems": false, "contributors": [], - "poLineNumber": "10008-1", + "poLineNumber": "10002-1", "vendorDetail": { "instructions": "", "vendorAccount": "1234", @@ -47,14 +53,15 @@ "receiptStatus": "Awaiting Receipt", "claimingActive": false, "reportingCodes": [], - "titleOrPackage": "Test 2", + "titleOrPackage": "1169-1", "automaticExport": false, - "purchaseOrderId": "1ab7ef6a-d1d4-4a4f-90a2-882aed18af14", + "purchaseOrderId": "0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c", "claimingInterval": 45, "fundDistribution": [], "acquisitionMethod": "306489dd-0053-49ee-a068-c316444a8f55", "searchLocationIds": [ - "fcd64ce1-6995-48f0-840e-89ffa2288371" + "fcd64ce1-6995-48f0-840e-89ffa2288371", + "184aae84-a5bf-4c6a-85ba-4a7c73026cd5" ], "donorOrganizationIds": [], "cancellationRestriction": true diff --git a/src/test/resources/mockdata/lines/po_line_collection.json b/src/test/resources/mockdata/lines/po_line_collection.json index 25bfb39e6..86e2ff163 100644 --- a/src/test/resources/mockdata/lines/po_line_collection.json +++ b/src/test/resources/mockdata/lines/po_line_collection.json @@ -1088,7 +1088,7 @@ "cancellationRestriction": true }, { - "id": "94b00678-9df4-494a-9891-ebc7ccb76a48", + "id": "2bf2b04c-716a-4c08-bc48-831f5d1e6802", "cost": { "currency": "USD", "discountType": "percentage", @@ -1117,16 +1117,16 @@ { "quantity": 1, "tenantId": "university", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", + "holdingId": "79b51935-de14-4715-b6de-3c3a8d749208", "quantityPhysical": 1 } ], "collection": false, - "instanceId": "e76fe67f-bea4-4bff-bfd3-2bc487417556", + "instanceId": "88fe2b5b-7c99-427e-9c8d-1647f5b0c502", "orderFormat": "Physical Resource", "checkinItems": false, "contributors": [], - "poLineNumber": "10008-1", + "poLineNumber": "10004-1", "vendorDetail": { "instructions": "", "vendorAccount": "1234", @@ -1136,9 +1136,9 @@ "receiptStatus": "Awaiting Receipt", "claimingActive": false, "reportingCodes": [], - "titleOrPackage": "Test 2", + "titleOrPackage": "1169-2", "automaticExport": false, - "purchaseOrderId": "1ab7ef6a-d1d4-4a4f-90a2-882aed18af14", + "purchaseOrderId": "b25f8ef6-04c4-4290-8531-9bbcefeb8c11", "claimingInterval": 45, "fundDistribution": [], "acquisitionMethod": "306489dd-0053-49ee-a068-c316444a8f55", @@ -1149,13 +1149,13 @@ "cancellationRestriction": true }, { - "id": "94b00678-9df4-494a-9891-ebc7ccb76a49", + "id": "aae3a75a-4e12-4e60-8c14-605b31d7593b", "cost": { "currency": "USD", "discountType": "percentage", "listUnitPrice": 1.0, - "quantityPhysical": 1, - "poLineEstimatedPrice": 1.0 + "quantityPhysical": 2, + "poLineEstimatedPrice": 2.0 }, "rush": false, "alerts": [], @@ -1178,16 +1178,22 @@ { "quantity": 1, "tenantId": "university", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", + "holdingId": "82220193-de57-4c10-afb0-0529b5368ff0", + "quantityPhysical": 1 + }, + { + "quantity": 1, + "tenantId": "university", + "holdingId": "5afdf421-7b02-43d7-9d93-917d1724a725", "quantityPhysical": 1 } ], "collection": false, - "instanceId": "e76fe67f-bea4-4bff-bfd3-2bc487417556", + "instanceId": "d97f0db3-7cb0-4179-bce0-1ad648aff60d", "orderFormat": "Physical Resource", "checkinItems": false, "contributors": [], - "poLineNumber": "10008-1", + "poLineNumber": "10002-1", "vendorDetail": { "instructions": "", "vendorAccount": "1234", @@ -1197,18 +1203,19 @@ "receiptStatus": "Awaiting Receipt", "claimingActive": false, "reportingCodes": [], - "titleOrPackage": "Test 2", + "titleOrPackage": "1169-1", "automaticExport": false, - "purchaseOrderId": "1ab7ef6a-d1d4-4a4f-90a2-882aed18af14", + "purchaseOrderId": "0c9a0e56-3518-4f0c-bfbb-98cc47b07f6c", "claimingInterval": 45, "fundDistribution": [], "acquisitionMethod": "306489dd-0053-49ee-a068-c316444a8f55", "searchLocationIds": [ - "fcd64ce1-6995-48f0-840e-89ffa2288371" + "fcd64ce1-6995-48f0-840e-89ffa2288371", + "184aae84-a5bf-4c6a-85ba-4a7c73026cd5" ], "donorOrganizationIds": [], "cancellationRestriction": true } ], - "totalRecords": 13 + "totalRecords": 14 } diff --git a/src/test/resources/mockdata/pieces/pieceRecords-2bf2b04c-716a-4c08-bc48-831f5d1e6802.json b/src/test/resources/mockdata/pieces/pieceRecords-2bf2b04c-716a-4c08-bc48-831f5d1e6802.json new file mode 100644 index 000000000..821400a8f --- /dev/null +++ b/src/test/resources/mockdata/pieces/pieceRecords-2bf2b04c-716a-4c08-bc48-831f5d1e6802.json @@ -0,0 +1,22 @@ +{ + "pieces": [ + { + "id": "eee55830-33bc-458d-81e6-a27211438adc", + "format": "Physical", + "itemId": "74ad86a6-d5cb-4dbb-bb41-d8d0c389e89f", + "isBound": false, + "titleId": "59cb23e5-aeb3-4a10-9485-5d666d731870", + "poLineId": "2bf2b04c-716a-4c08-bc48-831f5d1e6802", + "holdingId": "79b51935-de14-4715-b6de-3c3a8d749208", + "supplement": false, + "displaySummary": "1", + "displayToPublic": false, + "receivingStatus": "Received", + "displayOnHolding": false, + "discoverySuppress": false, + "receivingTenantId": "university", + "statusUpdatedDate": "2024-08-22T08:12:12.196+00:00" + } + ], + "totalRecords": 1 +} diff --git a/src/test/resources/mockdata/pieces/pieceRecords-94b00678-9df4-494a-9891-ebc7ccb76a48.json b/src/test/resources/mockdata/pieces/pieceRecords-94b00678-9df4-494a-9891-ebc7ccb76a48.json deleted file mode 100644 index e5ec745f3..000000000 --- a/src/test/resources/mockdata/pieces/pieceRecords-94b00678-9df4-494a-9891-ebc7ccb76a48.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "pieces": [ - { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62ca", - "format": "Physical", - "itemId": "0efc2a06-d376-488e-8593-1a5c66fa8266", - "isBound": false, - "titleId": "fa1ef0e6-748c-4a03-97b8-5070867d9d91", - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a48", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", - "displayToPublic": false, - "receivingStatus": "Received", - "displayOnHolding": false, - "receivingTenantId": "university", - "statusUpdatedDate": "2024-08-15T06:49:19.508+00:00" - } - ], - "totalRecords": 1 -} diff --git a/src/test/resources/mockdata/pieces/pieceRecords-94b00678-9df4-494a-9891-ebc7ccb76a49.json b/src/test/resources/mockdata/pieces/pieceRecords-94b00678-9df4-494a-9891-ebc7ccb76a49.json deleted file mode 100644 index b0bd30510..000000000 --- a/src/test/resources/mockdata/pieces/pieceRecords-94b00678-9df4-494a-9891-ebc7ccb76a49.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "pieces": [ - { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62cb", - "format": "Physical", - "itemId": "0efc2a06-d376-488e-8593-1a5c66fa8267", - "isBound": false, - "titleId": "fa1ef0e6-748c-4a03-97b8-5070867d9d92", - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a49", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", - "displayToPublic": false, - "receivingStatus": "Received", - "displayOnHolding": false, - "receivingTenantId": "university", - "statusUpdatedDate": "2024-08-15T06:49:19.508+00:00" - }, - { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62cc", - "format": "Physical", - "itemId": "0efc2a06-d376-488e-8593-1a5c66fa8268", - "isBound": false, - "titleId": "fa1ef0e6-748c-4a03-97b8-5070867d9d92", - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a49", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", - "displayToPublic": false, - "receivingStatus": "Received", - "displayOnHolding": false, - "receivingTenantId": "university", - "statusUpdatedDate": "2024-08-15T06:49:19.508+00:00" - } - ], - "totalRecords": 1 -} diff --git a/src/test/resources/mockdata/pieces/pieceRecords-aae3a75a-4e12-4e60-8c14-605b31d7593b.json b/src/test/resources/mockdata/pieces/pieceRecords-aae3a75a-4e12-4e60-8c14-605b31d7593b.json new file mode 100644 index 000000000..92afd4771 --- /dev/null +++ b/src/test/resources/mockdata/pieces/pieceRecords-aae3a75a-4e12-4e60-8c14-605b31d7593b.json @@ -0,0 +1,39 @@ +{ + "pieces": [ + { + "id": "8853e1d5-b7db-4b01-a1cd-a0661e78fc50", + "format": "Physical", + "itemId": "400ffb07-3f43-4c08-9e54-6070a8aa446d", + "isBound": false, + "titleId": "7e413351-79f0-4ef9-adb9-5c81dfd9f064", + "poLineId": "aae3a75a-4e12-4e60-8c14-605b31d7593b", + "holdingId": "5afdf421-7b02-43d7-9d93-917d1724a725", + "supplement": false, + "displaySummary": "1", + "displayToPublic": false, + "receivingStatus": "Received", + "displayOnHolding": false, + "discoverySuppress": false, + "receivingTenantId": "university", + "statusUpdatedDate": "2024-08-22T05:46:39.042+00:00" + }, + { + "id": "a977c7e7-61c3-40ec-9e17-a23263646688", + "format": "Physical", + "itemId": "05b10ba2-adc1-4fe2-aa0f-8a05633d135b", + "isBound": false, + "titleId": "7e413351-79f0-4ef9-adb9-5c81dfd9f064", + "poLineId": "aae3a75a-4e12-4e60-8c14-605b31d7593b", + "holdingId": "82220193-de57-4c10-afb0-0529b5368ff0", + "supplement": false, + "displaySummary": "2", + "displayToPublic": false, + "receivingStatus": "Received", + "displayOnHolding": false, + "discoverySuppress": false, + "receivingTenantId": "university", + "statusUpdatedDate": "2024-08-22T06:58:44.362+00:00" + } + ], + "totalRecords": 1 +} diff --git a/src/test/resources/mockdata/pieces/pieceRecordsCollection.json b/src/test/resources/mockdata/pieces/pieceRecordsCollection.json index 14ce2e4ac..d72abca2d 100644 --- a/src/test/resources/mockdata/pieces/pieceRecordsCollection.json +++ b/src/test/resources/mockdata/pieces/pieceRecordsCollection.json @@ -526,46 +526,55 @@ "statusUpdatedDate": "2024-08-14T13:15:58.372+00:00" }, { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62ca", + "id": "eee55830-33bc-458d-81e6-a27211438adc", "format": "Physical", - "itemId": "0efc2a06-d376-488e-8593-1a5c66fa8266", + "itemId": "74ad86a6-d5cb-4dbb-bb41-d8d0c389e89f", "isBound": false, - "titleId": "fa1ef0e6-748c-4a03-97b8-5070867d9d91", - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a48", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", + "titleId": "59cb23e5-aeb3-4a10-9485-5d666d731870", + "poLineId": "2bf2b04c-716a-4c08-bc48-831f5d1e6802", + "holdingId": "79b51935-de14-4715-b6de-3c3a8d749208", + "supplement": false, + "displaySummary": "1", "displayToPublic": false, "receivingStatus": "Expected", "displayOnHolding": false, + "discoverySuppress": false, "receivingTenantId": "university", - "statusUpdatedDate": "2024-08-15T06:49:19.508+00:00" + "statusUpdatedDate": "2024-08-22T08:12:12.196+00:00" }, { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62cb", + "id": "8853e1d5-b7db-4b01-a1cd-a0661e78fc50", "format": "Physical", - "itemId": "0efc2a06-d376-488e-8593-1a5c66fa8267", + "itemId": "400ffb07-3f43-4c08-9e54-6070a8aa446d", "isBound": false, - "titleId": "fa1ef0e6-748c-4a03-97b8-5070867d9d92", - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a49", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", + "titleId": "7e413351-79f0-4ef9-adb9-5c81dfd9f064", + "poLineId": "aae3a75a-4e12-4e60-8c14-605b31d7593b", + "holdingId": "5afdf421-7b02-43d7-9d93-917d1724a725", + "supplement": false, + "displaySummary": "1", "displayToPublic": false, "receivingStatus": "Expected", "displayOnHolding": false, + "discoverySuppress": false, "receivingTenantId": "university", - "statusUpdatedDate": "2024-08-15T06:49:19.508+00:00" + "statusUpdatedDate": "2024-08-22T05:46:39.042+00:00" }, { - "id": "1cdbe858-1489-406d-90bf-c5cb00cf62cc", + "id": "a977c7e7-61c3-40ec-9e17-a23263646688", "format": "Physical", - "itemId": "0efc2a06-d376-488e-8593-1a5c66fa8268", + "itemId": "05b10ba2-adc1-4fe2-aa0f-8a05633d135b", "isBound": false, - "titleId": "fa1ef0e6-748c-4a03-97b8-5070867d9d92", - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a49", - "holdingId": "46523917-e1c0-4cda-b0ad-84a90550cb73", + "titleId": "7e413351-79f0-4ef9-adb9-5c81dfd9f064", + "poLineId": "aae3a75a-4e12-4e60-8c14-605b31d7593b", + "holdingId": "82220193-de57-4c10-afb0-0529b5368ff0", + "supplement": false, + "displaySummary": "2", "displayToPublic": false, "receivingStatus": "Expected", "displayOnHolding": false, + "discoverySuppress": false, "receivingTenantId": "university", - "statusUpdatedDate": "2024-08-15T06:49:19.508+00:00" + "statusUpdatedDate": "2024-08-22T06:58:44.362+00:00" } ], "totalRecords": 64 diff --git a/src/test/resources/mockdata/titles/titles.json b/src/test/resources/mockdata/titles/titles.json index 95fc42cc4..687ed0fcc 100644 --- a/src/test/resources/mockdata/titles/titles.json +++ b/src/test/resources/mockdata/titles/titles.json @@ -30,30 +30,30 @@ "subscriptionInterval": 0 }, { - "id": "fa1ef0e6-748c-4a03-97b8-5070867d9d91", - "title": "Test 2", - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a48", + "id": "59cb23e5-aeb3-4a10-9485-5d666d731870", + "title": "1169-2", + "poLineId": "2bf2b04c-716a-4c08-bc48-831f5d1e6802", "acqUnitIds": [], - "instanceId": "e76fe67f-bea4-4bff-bfd3-2bc487417556", + "instanceId": "88fe2b5b-7c99-427e-9c8d-1647f5b0c502", "productIds": [], "bindItemIds": [], "contributors": [], - "poLineNumber": "10008-1", + "poLineNumber": "10004-1", "claimingActive": false, "isAcknowledged": false, "claimingInterval": 45, "subscriptionInterval": 0 }, { - "id": "fa1ef0e6-748c-4a03-97b8-5070867d9d92", - "title": "Test 3", - "poLineId": "94b00678-9df4-494a-9891-ebc7ccb76a49", + "id": "7e413351-79f0-4ef9-adb9-5c81dfd9f064", + "title": "1169-1", + "poLineId": "aae3a75a-4e12-4e60-8c14-605b31d7593b", "acqUnitIds": [], - "instanceId": "e76fe67f-bea4-4bff-bfd3-2bc487417556", + "instanceId": "d97f0db3-7cb0-4179-bce0-1ad648aff60d", "productIds": [], "bindItemIds": [], "contributors": [], - "poLineNumber": "10008-1", + "poLineNumber": "10002-1", "claimingActive": false, "isAcknowledged": false, "claimingInterval": 45,