Search in sources :

Example 1 with SequenceNumber

use of org.folio.rest.jaxrs.model.SequenceNumber in project mod-invoice by folio-org.

the class VouchersApiTest method testGetVoucherNumberStart.

@Test
public void testGetVoucherNumberStart() {
    logger.info("=== Test Get Voucher number start value - success ===");
    SequenceNumber number = verifyGet(VOUCHER_NUMBER_START_PATH, APPLICATION_JSON, 200).as(SequenceNumber.class);
    assertThat(number.getSequenceNumber()).isNotBlank();
}
Also used : SequenceNumber(org.folio.rest.jaxrs.model.SequenceNumber) Test(org.junit.jupiter.api.Test)

Example 2 with SequenceNumber

use of org.folio.rest.jaxrs.model.SequenceNumber in project mod-invoice by folio-org.

the class VoucherNumberService method setStartValue.

/**
 * This endpoint is a means for the UI to set/reset the start value of the voucher-number sequence
 * @param value start value to be set/reset
 * @return completable future on success or {@code null} if validation fails or an exception if any issue happens
 */
public CompletableFuture<Void> setStartValue(String value, RequestContext requestContext) {
    RequestEntry requestEntry = new RequestEntry(resourcesPath(VOUCHER_NUMBER_START) + "/{startNumber}");
    requestEntry.withPathParameter("startNumber", value);
    return restClient.post(requestEntry, null, requestContext, SequenceNumber.class).thenAccept(sequenceNumber -> {
    });
}
Also used : SequenceNumber(org.folio.rest.jaxrs.model.SequenceNumber) RequestEntry(org.folio.rest.core.models.RequestEntry)

Aggregations

SequenceNumber (org.folio.rest.jaxrs.model.SequenceNumber)2 RequestEntry (org.folio.rest.core.models.RequestEntry)1 Test (org.junit.jupiter.api.Test)1