use of org.folio.inventory.services.MoveItemIntoStatusService in project mod-inventory by folio-org.
the class Items method markItemAsTargetStatus.
private CompletableFuture<Void> markItemAsTargetStatus(RoutingContext routingContext, WebContext webContext, Clients clients) {
final var itemStatusName = ItemStatusURL.getItemStatusNameForUrl(routingContext.request().uri());
if (itemStatusName.isEmpty())
log.error("Item status for url $URL$ not found.".replace("$URL$", routingContext.request().uri()), new Exception());
final MoveItemIntoStatusService moveItemIntoStatusService = new MoveItemIntoStatusService(storage.getItemCollection(webContext), clients);
return moveItemIntoStatusService.markItemAs(itemStatusName.get(), webContext).thenAccept(item -> respondWithItemRepresentation(item, HTTP_OK.toInt(), routingContext, webContext));
}
Aggregations