Search in sources :

Example 1 with MoveItemIntoStatusService

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));
}
Also used : MoveItemIntoStatusService(org.folio.inventory.services.MoveItemIntoStatusService) UnsupportedEncodingException(java.io.UnsupportedEncodingException) MalformedURLException(java.net.MalformedURLException)

Aggregations

UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 MalformedURLException (java.net.MalformedURLException)1 MoveItemIntoStatusService (org.folio.inventory.services.MoveItemIntoStatusService)1