Search in sources :

Example 26 with RequestEntry

use of org.folio.rest.core.models.RequestEntry in project mod-orders by folio-org.

the class RolloverRetrieveService method getRolloversProgress.

public CompletableFuture<List<LedgerFiscalYearRolloverProgress>> getRolloversProgress(String rolloverId, RequestContext requestContext) {
    String query = "ledgerRolloverId==" + rolloverId;
    RequestEntry requestEntry = new RequestEntry(LEDGER_ROLLOVERS_PROGRESS_ENDPOINT).withQuery(query).withOffset(0).withLimit(1);
    return restClient.get(requestEntry, requestContext, LedgerFiscalYearRolloverProgressCollection.class).thenApply(LedgerFiscalYearRolloverProgressCollection::getLedgerFiscalYearRolloverProgresses);
}
Also used : LedgerFiscalYearRolloverProgressCollection(org.folio.rest.acq.model.finance.LedgerFiscalYearRolloverProgressCollection) RequestEntry(org.folio.rest.core.models.RequestEntry)

Example 27 with RequestEntry

use of org.folio.rest.core.models.RequestEntry in project mod-orders by folio-org.

the class RolloverRetrieveService method getLedgerFyRollovers.

public CompletableFuture<LedgerFiscalYearRolloverCollection> getLedgerFyRollovers(String fyId, String ledgerId, RequestContext requestContext) {
    String query = "toFiscalYearId==" + fyId + AND + "ledgerId==" + ledgerId;
    RequestEntry requestEntry = new RequestEntry(LEDGER_ROLLOVERS_ENDPOINT).withQuery(query).withOffset(0).withLimit(1);
    return restClient.get(requestEntry, requestContext, LedgerFiscalYearRolloverCollection.class);
}
Also used : RequestEntry(org.folio.rest.core.models.RequestEntry)

Example 28 with RequestEntry

use of org.folio.rest.core.models.RequestEntry in project mod-orders by folio-org.

the class InvoiceService method getInvoicesChunkByInvoiceIds.

private CompletableFuture<InvoiceCollection> getInvoicesChunkByInvoiceIds(Collection<String> invoiceIds, RequestContext requestContext) {
    String query = convertIdsToCqlQuery(invoiceIds);
    RequestEntry requestEntry = new RequestEntry(INVOICE_ENDPOINT).withQuery(query).withOffset(0).withLimit(Integer.MAX_VALUE);
    return restClient.get(requestEntry, requestContext, InvoiceCollection.class);
}
Also used : RequestEntry(org.folio.rest.core.models.RequestEntry)

Example 29 with RequestEntry

use of org.folio.rest.core.models.RequestEntry in project mod-orders by folio-org.

the class PurchaseOrderLineService method getOrderLinesChunk.

private CompletableFuture<List<PoLine>> getOrderLinesChunk(List<String> orderLineIds, RequestContext requestContext) {
    String query = convertIdsToCqlQuery(orderLineIds);
    RequestEntry requestEntry = new RequestEntry(ENDPOINT).withQuery(query).withOffset(0).withLimit(MAX_IDS_FOR_GET_RQ);
    return restClient.get(requestEntry, requestContext, PoLineCollection.class).thenApply(PoLineCollection::getPoLines);
}
Also used : PoLineCollection(org.folio.rest.jaxrs.model.PoLineCollection) RequestEntry(org.folio.rest.core.models.RequestEntry)

Example 30 with RequestEntry

use of org.folio.rest.core.models.RequestEntry in project mod-orders by folio-org.

the class PurchaseOrderStorageService method getOrdersChunk.

private CompletableFuture<List<PurchaseOrder>> getOrdersChunk(List<String> orderIds, RequestContext requestContext) {
    String query = convertIdsToCqlQuery(orderIds);
    RequestEntry requestEntry = new RequestEntry(ENDPOINT).withQuery(query).withOffset(0).withLimit(MAX_IDS_FOR_GET_RQ);
    return restClient.get(requestEntry, requestContext, PurchaseOrderCollection.class).thenApply(PurchaseOrderCollection::getPurchaseOrders);
}
Also used : PurchaseOrderCollection(org.folio.rest.jaxrs.model.PurchaseOrderCollection) RequestEntry(org.folio.rest.core.models.RequestEntry)

Aggregations

RequestEntry (org.folio.rest.core.models.RequestEntry)96 JsonObject (io.vertx.core.json.JsonObject)38 CompletableFuture (java.util.concurrent.CompletableFuture)37 RequestContext (org.folio.rest.core.models.RequestContext)33 Test (org.junit.jupiter.api.Test)30 Collections (java.util.Collections)22 List (java.util.List)21 RestClient (org.folio.rest.core.RestClient)21 LogManager (org.apache.logging.log4j.LogManager)20 Logger (org.apache.logging.log4j.Logger)20 Map (java.util.Map)19 CompletionException (java.util.concurrent.CompletionException)19 Transaction (org.folio.rest.acq.model.finance.Transaction)18 CompletableFuture.completedFuture (java.util.concurrent.CompletableFuture.completedFuture)17 Collectors.toList (java.util.stream.Collectors.toList)16 TenantTool (org.folio.rest.tools.utils.TenantTool)16 Collections.singletonList (java.util.Collections.singletonList)14 UUID (java.util.UUID)14 Collectors.joining (java.util.stream.Collectors.joining)14 Vertx (io.vertx.core.Vertx)13