Search in sources :

Example 21 with Title

use of org.folio.rest.jaxrs.model.Title in project mod-orders by folio-org.

the class PieceUpdateFlowInventoryManager method nonPackageUpdateTitleWithInstance.

private CompletableFuture<String> nonPackageUpdateTitleWithInstance(PieceUpdateHolder holder, RequestContext requestContext) {
    CompositePoLine poLineToSave = holder.getPoLineToSave();
    Piece pieceToUpdate = holder.getPieceToUpdate();
    if (poLineToSave.getInstanceId() == null && !PoLineCommonUtil.isInventoryUpdateNotRequired(poLineToSave)) {
        return titlesService.getTitleById(pieceToUpdate.getTitleId(), requestContext).thenCompose(title -> {
            if (title.getInstanceId() == null) {
                return createTitleInstance(title, requestContext);
            }
            return completedFuture(title.getInstanceId());
        }).thenApply(instanceId -> poLineToSave.withInstanceId(instanceId).getInstanceId());
    }
    return completedFuture(poLineToSave.getInstanceId());
}
Also used : Location(org.folio.rest.jaxrs.model.Location) ID(org.folio.service.inventory.InventoryManager.ID) Piece(org.folio.rest.jaxrs.model.Piece) DefaultPieceFlowsValidator(org.folio.service.pieces.flows.DefaultPieceFlowsValidator) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) CompletableFuture(java.util.concurrent.CompletableFuture) FolioVertxCompletableFuture(org.folio.completablefuture.FolioVertxCompletableFuture) ITEM_HOLDINGS_RECORD_ID(org.folio.service.inventory.InventoryManager.ITEM_HOLDINGS_RECORD_ID) ITEM_PURCHASE_ORDER_LINE_IDENTIFIER(org.folio.service.inventory.InventoryManager.ITEM_PURCHASE_ORDER_LINE_IDENTIFIER) Title(org.folio.rest.jaxrs.model.Title) PoLineCommonUtil(org.folio.orders.utils.PoLineCommonUtil) Logger(org.apache.logging.log4j.Logger) TitlesService(org.folio.service.titles.TitlesService) Pair(org.apache.commons.lang3.tuple.Pair) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) RequestContext(org.folio.rest.core.models.RequestContext) PieceUpdateInventoryService(org.folio.service.pieces.PieceUpdateInventoryService) Optional(java.util.Optional) InventoryManager(org.folio.service.inventory.InventoryManager) JsonObject(io.vertx.core.json.JsonObject) LogManager(org.apache.logging.log4j.LogManager) PieceUpdateHolder(org.folio.models.pieces.PieceUpdateHolder) Piece(org.folio.rest.jaxrs.model.Piece) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine)

Example 22 with Title

use of org.folio.rest.jaxrs.model.Title in project mod-orders by folio-org.

the class TitlesService method createTitle.

public CompletableFuture<Title> createTitle(Title title, RequestContext requestContext) {
    CompletableFuture<Title> future = new CompletableFuture<>();
    populateTitle(title, title.getPoLineId(), requestContext).thenCompose(v -> {
        RequestEntry requestEntry = new RequestEntry(ENDPOINT);
        return restClient.post(requestEntry, title, requestContext, Title.class);
    }).thenAccept(future::complete).exceptionally(t -> {
        future.completeExceptionally(t);
        return null;
    });
    return future;
}
Also used : CompletableFuture(java.util.concurrent.CompletableFuture) Title(org.folio.rest.jaxrs.model.Title) RequestEntry(org.folio.rest.core.models.RequestEntry)

Example 23 with Title

use of org.folio.rest.jaxrs.model.Title in project mod-orders by folio-org.

the class CheckinReceivePiecesHelper method processHoldingsUpdate.

protected CompletableFuture<Void> processHoldingsUpdate(Map<String, Map<String, Location>> pieceLocationsGroupedByPoLine, Map<String, List<Piece>> piecesGroupedByPoLine, PoLineAndTitleById poLinesAndTitlesById, RequestContext requestContext) {
    List<CompletableFuture<Boolean>> futuresForHoldingsUpdates = new ArrayList<>();
    StreamEx.ofValues(piecesGroupedByPoLine).flatMap(List::stream).forEach(piece -> {
        CompositePoLine poLine = poLinesAndTitlesById.poLineById.get(piece.getPoLineId());
        if (poLine == null) {
            logger.error("POLine associated with piece '{}' cannot be found", piece.getId());
            addError(piece.getPoLineId(), piece.getId(), ITEM_UPDATE_FAILED.toError());
            return;
        }
        Title title = poLinesAndTitlesById.titleById.get(piece.getTitleId());
        if (title == null) {
            logger.error("Piece with id {} : title with id {} was not found within the po line titles.", piece.getId(), piece.getTitleId());
            addError(piece.getPoLineId(), piece.getId(), ITEM_UPDATE_FAILED.toError());
            return;
        }
        Location receivedPieceLocation = pieceLocationsGroupedByPoLine.get(poLine.getId()).get(piece.getId());
        if (holdingUpdateOnCheckinReceiveRequired(piece, receivedPieceLocation, poLine)) {
            futuresForHoldingsUpdates.add(createHoldingsForChangedLocations(piece, title.getInstanceId(), receivedPieceLocation, requestContext));
        }
    });
    return collectResultsOnSuccess(futuresForHoldingsUpdates).thenAccept(results -> {
        if (logger.isDebugEnabled()) {
            long successQty = results.stream().filter(result -> result).count();
            logger.debug("{} out of {} holdings successfully processed", successQty, results.size());
        }
    });
}
Also used : ITEM_UPDATE_FAILED(org.folio.rest.core.exceptions.ErrorCodes.ITEM_UPDATE_FAILED) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) ProcessingStatus(org.folio.rest.jaxrs.model.ProcessingStatus) Autowired(org.springframework.beans.factory.annotation.Autowired) HelperUtils.collectResultsOnSuccess(org.folio.orders.utils.HelperUtils.collectResultsOnSuccess) PoLine(org.folio.rest.jaxrs.model.PoLine) PIECE_NOT_FOUND(org.folio.rest.core.exceptions.ErrorCodes.PIECE_NOT_FOUND) StringUtils(org.apache.commons.lang3.StringUtils) Context(io.vertx.core.Context) PoLineCommonUtil(org.folio.orders.utils.PoLineCommonUtil) HelperUtils.convertIdsToCqlQuery(org.folio.orders.utils.HelperUtils.convertIdsToCqlQuery) ProtectionService(org.folio.service.ProtectionService) Map(java.util.Map) PIECE_ALREADY_RECEIVED(org.folio.rest.core.exceptions.ErrorCodes.PIECE_ALREADY_RECEIVED) JsonObject(io.vertx.core.json.JsonObject) FULLY_RECEIVED(org.folio.rest.jaxrs.model.PoLine.ReceiptStatus.FULLY_RECEIVED) ReceiptStatus(org.folio.rest.jaxrs.model.PoLine.ReceiptStatus) HelperUtils.handlePutRequest(org.folio.orders.utils.HelperUtils.handlePutRequest) Location(org.folio.rest.jaxrs.model.Location) PurchaseOrder(org.folio.rest.jaxrs.model.PurchaseOrder) Collection(java.util.Collection) AWAITING_RECEIPT(org.folio.rest.jaxrs.model.PoLine.ReceiptStatus.AWAITING_RECEIPT) Set(java.util.Set) HelperUtils.handleGetRequest(org.folio.orders.utils.HelperUtils.handleGetRequest) Collectors(java.util.stream.Collectors) List(java.util.List) PIECE_POL_MISMATCH(org.folio.rest.core.exceptions.ErrorCodes.PIECE_POL_MISMATCH) Logger(org.apache.logging.log4j.Logger) Eresource(org.folio.rest.jaxrs.model.Eresource) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) PieceCollection(org.folio.rest.jaxrs.model.PieceCollection) HttpClientInterface(org.folio.rest.tools.client.interfaces.HttpClientInterface) StreamEx(one.util.streamex.StreamEx) Optional(java.util.Optional) USER_HAS_NO_PERMISSIONS(org.folio.rest.core.exceptions.ErrorCodes.USER_HAS_NO_PERMISSIONS) PIECES_STORAGE(org.folio.orders.utils.ResourcePathResolver.PIECES_STORAGE) PIECE_NOT_RETRIEVED(org.folio.rest.core.exceptions.ErrorCodes.PIECE_NOT_RETRIEVED) ProtectedOperationType(org.folio.orders.utils.ProtectedOperationType) Collectors.groupingBy(java.util.stream.Collectors.groupingBy) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) ArrayList(java.util.ArrayList) MAX_IDS_FOR_GET_RQ(org.folio.rest.RestConstants.MAX_IDS_FOR_GET_RQ) ITEM_HOLDINGS_RECORD_ID(org.folio.service.inventory.InventoryManager.ITEM_HOLDINGS_RECORD_ID) HashSet(java.util.HashSet) ReceivingResult(org.folio.rest.jaxrs.model.ReceivingResult) Title(org.folio.rest.jaxrs.model.Title) GET_PURCHASE_ORDERS(org.folio.helper.PurchaseOrderHelper.GET_PURCHASE_ORDERS) ResourcePathResolver.resourcesPath(org.folio.orders.utils.ResourcePathResolver.resourcesPath) TitlesService(org.folio.service.titles.TitlesService) PIECE_UPDATE_FAILED(org.folio.rest.core.exceptions.ErrorCodes.PIECE_UPDATE_FAILED) PieceCreateFlowInventoryManager(org.folio.service.pieces.flows.create.PieceCreateFlowInventoryManager) RequestContext(org.folio.rest.core.models.RequestContext) EMPTY(org.apache.commons.lang3.StringUtils.EMPTY) InventoryManager(org.folio.service.inventory.InventoryManager) ReceivingItemResult(org.folio.rest.jaxrs.model.ReceivingItemResult) Physical(org.folio.rest.jaxrs.model.Physical) Piece(org.folio.rest.jaxrs.model.Piece) HelperUtils(org.folio.orders.utils.HelperUtils) LOC_NOT_PROVIDED(org.folio.rest.core.exceptions.ErrorCodes.LOC_NOT_PROVIDED) EntryStream(one.util.streamex.EntryStream) PARTIALLY_RECEIVED(org.folio.rest.jaxrs.model.PoLine.ReceiptStatus.PARTIALLY_RECEIVED) Error(org.folio.rest.jaxrs.model.Error) ResourcePathResolver.resourceByIdPath(org.folio.orders.utils.ResourcePathResolver.resourceByIdPath) HelperUtils.buildQuery(org.folio.orders.utils.HelperUtils.buildQuery) PurchaseOrderCollection(org.folio.rest.jaxrs.model.PurchaseOrderCollection) ITEM_NOT_RETRIEVED(org.folio.rest.core.exceptions.ErrorCodes.ITEM_NOT_RETRIEVED) PurchaseOrderLineService(org.folio.service.orders.PurchaseOrderLineService) HelperUtils.encodeQuery(org.folio.orders.utils.HelperUtils.encodeQuery) Collections(java.util.Collections) LogManager(org.apache.logging.log4j.LogManager) CompletableFuture(java.util.concurrent.CompletableFuture) ArrayList(java.util.ArrayList) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) Title(org.folio.rest.jaxrs.model.Title) Location(org.folio.rest.jaxrs.model.Location)

Example 24 with Title

use of org.folio.rest.jaxrs.model.Title in project mod-orders by folio-org.

the class CheckinReceivePiecesHelper method processItemsUpdate.

protected CompletableFuture<Map<String, List<Piece>>> processItemsUpdate(Map<String, Map<String, Location>> pieceLocationsGroupedByPoLine, Map<String, List<Piece>> piecesGroupedByPoLine, List<JsonObject> items, PoLineAndTitleById poLinesAndTitlesById, RequestContext requestContext) {
    List<CompletableFuture<Boolean>> futuresForItemsUpdates = new ArrayList<>();
    Map<String, Piece> piecesWithItems = collectPiecesWithItemId(piecesGroupedByPoLine);
    // If there are no pieces with ItemId, continue
    if (piecesWithItems.isEmpty()) {
        return completedFuture(piecesGroupedByPoLine);
    }
    for (JsonObject item : items) {
        String itemId = item.getString(ID);
        Piece piece = piecesWithItems.get(itemId);
        CompositePoLine poLine = poLinesAndTitlesById.poLineById.get(piece.getPoLineId());
        if (poLine == null)
            continue;
        Title title = poLinesAndTitlesById.titleById.get(piece.getTitleId());
        if (title == null)
            continue;
        Location pieceLocation = pieceLocationsGroupedByPoLine.get(poLine.getId()).get(piece.getId());
        if (holdingUpdateOnCheckinReceiveRequired(piece, pieceLocation, poLine) && !isRevertToOnOrder(piece)) {
            String holdingKey = buildProcessedHoldingKey(pieceLocation, title.getInstanceId());
            String holdingId = processedHoldings.get(holdingKey);
            item.put(ITEM_HOLDINGS_RECORD_ID, holdingId);
        }
        futuresForItemsUpdates.add(receiveInventoryItemAndUpdatePiece(item, piece, requestContext));
    }
    return collectResultsOnSuccess(futuresForItemsUpdates).thenApply(results -> {
        if (logger.isDebugEnabled()) {
            long successQty = results.stream().filter(result -> result).count();
            logger.debug("{} out of {} inventory item(s) successfully updated", successQty, results.size());
        }
        return piecesGroupedByPoLine;
    });
}
Also used : ITEM_UPDATE_FAILED(org.folio.rest.core.exceptions.ErrorCodes.ITEM_UPDATE_FAILED) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) ProcessingStatus(org.folio.rest.jaxrs.model.ProcessingStatus) Autowired(org.springframework.beans.factory.annotation.Autowired) HelperUtils.collectResultsOnSuccess(org.folio.orders.utils.HelperUtils.collectResultsOnSuccess) PoLine(org.folio.rest.jaxrs.model.PoLine) PIECE_NOT_FOUND(org.folio.rest.core.exceptions.ErrorCodes.PIECE_NOT_FOUND) StringUtils(org.apache.commons.lang3.StringUtils) Context(io.vertx.core.Context) PoLineCommonUtil(org.folio.orders.utils.PoLineCommonUtil) HelperUtils.convertIdsToCqlQuery(org.folio.orders.utils.HelperUtils.convertIdsToCqlQuery) ProtectionService(org.folio.service.ProtectionService) Map(java.util.Map) PIECE_ALREADY_RECEIVED(org.folio.rest.core.exceptions.ErrorCodes.PIECE_ALREADY_RECEIVED) JsonObject(io.vertx.core.json.JsonObject) FULLY_RECEIVED(org.folio.rest.jaxrs.model.PoLine.ReceiptStatus.FULLY_RECEIVED) ReceiptStatus(org.folio.rest.jaxrs.model.PoLine.ReceiptStatus) HelperUtils.handlePutRequest(org.folio.orders.utils.HelperUtils.handlePutRequest) Location(org.folio.rest.jaxrs.model.Location) PurchaseOrder(org.folio.rest.jaxrs.model.PurchaseOrder) Collection(java.util.Collection) AWAITING_RECEIPT(org.folio.rest.jaxrs.model.PoLine.ReceiptStatus.AWAITING_RECEIPT) Set(java.util.Set) HelperUtils.handleGetRequest(org.folio.orders.utils.HelperUtils.handleGetRequest) Collectors(java.util.stream.Collectors) List(java.util.List) PIECE_POL_MISMATCH(org.folio.rest.core.exceptions.ErrorCodes.PIECE_POL_MISMATCH) Logger(org.apache.logging.log4j.Logger) Eresource(org.folio.rest.jaxrs.model.Eresource) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) PieceCollection(org.folio.rest.jaxrs.model.PieceCollection) HttpClientInterface(org.folio.rest.tools.client.interfaces.HttpClientInterface) StreamEx(one.util.streamex.StreamEx) Optional(java.util.Optional) USER_HAS_NO_PERMISSIONS(org.folio.rest.core.exceptions.ErrorCodes.USER_HAS_NO_PERMISSIONS) PIECES_STORAGE(org.folio.orders.utils.ResourcePathResolver.PIECES_STORAGE) PIECE_NOT_RETRIEVED(org.folio.rest.core.exceptions.ErrorCodes.PIECE_NOT_RETRIEVED) ProtectedOperationType(org.folio.orders.utils.ProtectedOperationType) Collectors.groupingBy(java.util.stream.Collectors.groupingBy) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) ArrayList(java.util.ArrayList) MAX_IDS_FOR_GET_RQ(org.folio.rest.RestConstants.MAX_IDS_FOR_GET_RQ) ITEM_HOLDINGS_RECORD_ID(org.folio.service.inventory.InventoryManager.ITEM_HOLDINGS_RECORD_ID) HashSet(java.util.HashSet) ReceivingResult(org.folio.rest.jaxrs.model.ReceivingResult) Title(org.folio.rest.jaxrs.model.Title) GET_PURCHASE_ORDERS(org.folio.helper.PurchaseOrderHelper.GET_PURCHASE_ORDERS) ResourcePathResolver.resourcesPath(org.folio.orders.utils.ResourcePathResolver.resourcesPath) TitlesService(org.folio.service.titles.TitlesService) PIECE_UPDATE_FAILED(org.folio.rest.core.exceptions.ErrorCodes.PIECE_UPDATE_FAILED) PieceCreateFlowInventoryManager(org.folio.service.pieces.flows.create.PieceCreateFlowInventoryManager) RequestContext(org.folio.rest.core.models.RequestContext) EMPTY(org.apache.commons.lang3.StringUtils.EMPTY) InventoryManager(org.folio.service.inventory.InventoryManager) ReceivingItemResult(org.folio.rest.jaxrs.model.ReceivingItemResult) Physical(org.folio.rest.jaxrs.model.Physical) Piece(org.folio.rest.jaxrs.model.Piece) HelperUtils(org.folio.orders.utils.HelperUtils) LOC_NOT_PROVIDED(org.folio.rest.core.exceptions.ErrorCodes.LOC_NOT_PROVIDED) EntryStream(one.util.streamex.EntryStream) PARTIALLY_RECEIVED(org.folio.rest.jaxrs.model.PoLine.ReceiptStatus.PARTIALLY_RECEIVED) Error(org.folio.rest.jaxrs.model.Error) ResourcePathResolver.resourceByIdPath(org.folio.orders.utils.ResourcePathResolver.resourceByIdPath) HelperUtils.buildQuery(org.folio.orders.utils.HelperUtils.buildQuery) PurchaseOrderCollection(org.folio.rest.jaxrs.model.PurchaseOrderCollection) ITEM_NOT_RETRIEVED(org.folio.rest.core.exceptions.ErrorCodes.ITEM_NOT_RETRIEVED) PurchaseOrderLineService(org.folio.service.orders.PurchaseOrderLineService) HelperUtils.encodeQuery(org.folio.orders.utils.HelperUtils.encodeQuery) Collections(java.util.Collections) LogManager(org.apache.logging.log4j.LogManager) CompletableFuture(java.util.concurrent.CompletableFuture) Piece(org.folio.rest.jaxrs.model.Piece) ArrayList(java.util.ArrayList) JsonObject(io.vertx.core.json.JsonObject) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) Title(org.folio.rest.jaxrs.model.Title) Location(org.folio.rest.jaxrs.model.Location)

Example 25 with Title

use of org.folio.rest.jaxrs.model.Title in project mod-orders by folio-org.

the class InventoryManager method buildInstanceRecordJsonObject.

public JsonObject buildInstanceRecordJsonObject(Title title, JsonObject lookupObj) {
    JsonObject instance = new JsonObject();
    // MODORDERS-145 The Source and source code are required by schema
    instance.put(INSTANCE_SOURCE, SOURCE_FOLIO);
    instance.put(INSTANCE_TITLE, title.getTitle());
    if (title.getEdition() != null) {
        instance.put(INSTANCE_EDITIONS, new JsonArray(singletonList(title.getEdition())));
    }
    instance.put(INSTANCE_STATUS_ID, lookupObj.getString(INSTANCE_STATUSES));
    instance.put(INSTANCE_TYPE_ID, lookupObj.getString(INSTANCE_TYPES));
    if (title.getPublisher() != null || title.getPublishedDate() != null) {
        JsonObject publication = new JsonObject();
        publication.put(INSTANCE_PUBLISHER, title.getPublisher());
        publication.put(INSTANCE_DATE_OF_PUBLICATION, title.getPublishedDate());
        instance.put(INSTANCE_PUBLICATION, new JsonArray(singletonList(publication)));
    }
    List<Contributor> titleContributors = title.getContributors();
    if (isNotEmpty(titleContributors)) {
        List<JsonObject> contributors = titleContributors.stream().map(compPolContributor -> {
            JsonObject invContributor = new JsonObject();
            invContributor.put(CONTRIBUTOR_NAME_TYPE_ID, compPolContributor.getContributorNameTypeId());
            invContributor.put(CONTRIBUTOR_NAME, compPolContributor.getContributor());
            return invContributor;
        }).collect(toList());
        instance.put(INSTANCE_CONTRIBUTORS, contributors);
    }
    List<ProductId> productIds = title.getProductIds();
    if (CollectionUtils.isNotEmpty(productIds)) {
        List<JsonObject> identifiers = productIds.stream().map(pId -> {
            JsonObject identifier = new JsonObject();
            identifier.put(INSTANCE_IDENTIFIER_TYPE_ID, pId.getProductIdType());
            identifier.put(INSTANCE_IDENTIFIER_TYPE_VALUE, pId.getProductId());
            return identifier;
        }).collect(toList());
        instance.put(INSTANCE_IDENTIFIERS, new JsonArray(identifiers));
    }
    return instance;
}
Also used : JsonArray(io.vertx.core.json.JsonArray) CheckInPiece(org.folio.rest.jaxrs.model.CheckInPiece) CompletableFuture.completedFuture(java.util.concurrent.CompletableFuture.completedFuture) HelperUtils.collectResultsOnSuccess(org.folio.orders.utils.HelperUtils.collectResultsOnSuccess) StringUtils(org.apache.commons.lang3.StringUtils) Context(io.vertx.core.Context) StreamEx.ofSubLists(one.util.streamex.StreamEx.ofSubLists) MISSING_INSTANCE_TYPE(org.folio.rest.core.exceptions.ErrorCodes.MISSING_INSTANCE_TYPE) Collections.singletonList(java.util.Collections.singletonList) ISBN_NOT_VALID(org.folio.rest.core.exceptions.ErrorCodes.ISBN_NOT_VALID) PoLineCommonUtil(org.folio.orders.utils.PoLineCommonUtil) HelperUtils.convertIdsToCqlQuery(org.folio.orders.utils.HelperUtils.convertIdsToCqlQuery) Map(java.util.Map) ListUtils(org.apache.commons.collections4.ListUtils) HOLDINGS_BY_ID_NOT_FOUND(org.folio.rest.core.exceptions.ErrorCodes.HOLDINGS_BY_ID_NOT_FOUND) PARTIALLY_RETURNED_COLLECTION(org.folio.rest.core.exceptions.ErrorCodes.PARTIALLY_RETURNED_COLLECTION) JsonObject(io.vertx.core.json.JsonObject) ORDER_CONFIG_MODULE_NAME(org.folio.orders.utils.HelperUtils.ORDER_CONFIG_MODULE_NAME) PieceStorageService(org.folio.service.pieces.PieceStorageService) LANG(org.folio.orders.utils.HelperUtils.LANG) Location(org.folio.rest.jaxrs.model.Location) Collection(java.util.Collection) ErrorCodes(org.folio.rest.core.exceptions.ErrorCodes) CompletionException(java.util.concurrent.CompletionException) HelperUtils.handleGetRequest(org.folio.orders.utils.HelperUtils.handleGetRequest) Collectors(java.util.stream.Collectors) TenantTool(org.folio.rest.tools.utils.TenantTool) Collectors.joining(java.util.stream.Collectors.joining) ConfigurationEntriesService(org.folio.service.configuration.ConfigurationEntriesService) Objects(java.util.Objects) List(java.util.List) CollectionUtils.isNotEmpty(org.apache.commons.collections4.CollectionUtils.isNotEmpty) Logger(org.apache.logging.log4j.Logger) Response(javax.ws.rs.core.Response) PieceItemPair(org.folio.models.PieceItemPair) CompositePoLine(org.folio.rest.jaxrs.model.CompositePoLine) StreamEx(one.util.streamex.StreamEx) HelperUtils.getFirstObjectFromResponse(org.folio.orders.utils.HelperUtils.getFirstObjectFromResponse) Optional(java.util.Optional) Parameter(org.folio.rest.jaxrs.model.Parameter) IntStreamEx(one.util.streamex.IntStreamEx) ITEM_CREATION_FAILED(org.folio.rest.core.exceptions.ErrorCodes.ITEM_CREATION_FAILED) MISSING_INSTANCE_STATUS(org.folio.rest.core.exceptions.ErrorCodes.MISSING_INSTANCE_STATUS) ELECTRONIC_RESOURCE(org.folio.rest.jaxrs.model.CompositePoLine.OrderFormat.ELECTRONIC_RESOURCE) RestClient(org.folio.rest.core.RestClient) HttpException(org.folio.rest.core.exceptions.HttpException) ProductId(org.folio.rest.jaxrs.model.ProductId) CompletableFuture(java.util.concurrent.CompletableFuture) FolioVertxCompletableFuture(org.folio.completablefuture.FolioVertxCompletableFuture) Contributor(org.folio.rest.jaxrs.model.Contributor) CollectionUtils(org.apache.commons.collections4.CollectionUtils) SharedData(io.vertx.core.shareddata.SharedData) ArrayList(java.util.ArrayList) MAX_IDS_FOR_GET_RQ(org.folio.rest.RestConstants.MAX_IDS_FOR_GET_RQ) MISSING_LOAN_TYPE(org.folio.rest.core.exceptions.ErrorCodes.MISSING_LOAN_TYPE) PoLineUpdateHolder(org.folio.models.PoLineUpdateHolder) Title(org.folio.rest.jaxrs.model.Title) HelperUtils.extractId(org.folio.orders.utils.HelperUtils.extractId) CompletableFuture.allOf(java.util.concurrent.CompletableFuture.allOf) RequestContext(org.folio.rest.core.models.RequestContext) ReceivedItem(org.folio.rest.jaxrs.model.ReceivedItem) HelperUtils.isProductIdsExist(org.folio.orders.utils.HelperUtils.isProductIdsExist) Piece(org.folio.rest.jaxrs.model.Piece) HelperUtils(org.folio.orders.utils.HelperUtils) MISSING_CONTRIBUTOR_NAME_TYPE(org.folio.rest.core.exceptions.ErrorCodes.MISSING_CONTRIBUTOR_NAME_TYPE) RequestEntry(org.folio.rest.core.models.RequestEntry) PostResponseType(org.folio.rest.core.PostResponseType) InventoryException(org.folio.rest.core.exceptions.InventoryException) NOT_FOUND(org.folio.rest.RestConstants.NOT_FOUND) Error(org.folio.rest.jaxrs.model.Error) JsonArray(io.vertx.core.json.JsonArray) Collectors.toList(java.util.stream.Collectors.toList) Lock(io.vertx.core.shareddata.Lock) HelperUtils.encodeQuery(org.folio.orders.utils.HelperUtils.encodeQuery) Collections(java.util.Collections) LogManager(org.apache.logging.log4j.LogManager) JsonObject(io.vertx.core.json.JsonObject) Contributor(org.folio.rest.jaxrs.model.Contributor) ProductId(org.folio.rest.jaxrs.model.ProductId)

Aggregations

Title (org.folio.rest.jaxrs.model.Title)42 Test (org.junit.jupiter.api.Test)28 Piece (org.folio.rest.jaxrs.model.Piece)23 CompositePoLine (org.folio.rest.jaxrs.model.CompositePoLine)19 Location (org.folio.rest.jaxrs.model.Location)19 JsonObject (io.vertx.core.json.JsonObject)17 ArrayList (java.util.ArrayList)10 List (java.util.List)9 CompletableFuture (java.util.concurrent.CompletableFuture)8 Cost (org.folio.rest.jaxrs.model.Cost)8 PoLine (org.folio.rest.jaxrs.model.PoLine)8 PurchaseOrder (org.folio.rest.jaxrs.model.PurchaseOrder)8 CompletableFuture.completedFuture (java.util.concurrent.CompletableFuture.completedFuture)7 Collectors (java.util.stream.Collectors)7 Eresource (org.folio.rest.jaxrs.model.Eresource)7 Context (io.vertx.core.Context)6 Map (java.util.Map)6 PieceUpdateHolder (org.folio.models.pieces.PieceUpdateHolder)6 Optional (java.util.Optional)5 LogManager (org.apache.logging.log4j.LogManager)5