Search in sources :

Example 1 with ExchangeRate

use of org.folio.rest.acq.model.finance.ExchangeRate in project mod-invoice by folio-org.

the class MockServer method handleGetRateOfExchange.

private void handleGetRateOfExchange(RoutingContext ctx) {
    logger.info("handleGetRateOfExchange: " + ctx.request().path());
    String fromParam = StringUtils.trimToEmpty(ctx.request().getParam("from"));
    String toParam = StringUtils.trimToEmpty(ctx.request().getParam("to"));
    ExchangeRate exchangeRate = new ExchangeRate().withExchangeRate(1.0d).withFrom(fromParam).withTo(toParam);
    addServerRqRsData(HttpMethod.GET, FINANCE_EXCHANGE_RATE, new JsonObject().mapFrom(exchangeRate));
    serverResponse(ctx, 200, APPLICATION_JSON, JsonObject.mapFrom(exchangeRate).encodePrettily());
}
Also used : ExchangeRate(org.folio.rest.acq.model.finance.ExchangeRate) JsonObject(io.vertx.core.json.JsonObject)

Example 2 with ExchangeRate

use of org.folio.rest.acq.model.finance.ExchangeRate in project mod-orders by folio-org.

the class MockServer method handleGetRateOfExchange.

private void handleGetRateOfExchange(RoutingContext ctx) {
    logger.info("handleGetRateOfExchange: " + ctx.request().path());
    String fromParam = StringUtils.trimToEmpty(ctx.request().getParam("from"));
    String toParam = StringUtils.trimToEmpty(ctx.request().getParam("to"));
    ExchangeRate exchangeRate = new ExchangeRate().withExchangeRate(1.0d).withFrom(fromParam).withTo(toParam);
    addServerRqRsData(HttpMethod.GET, FINANCE_EXCHANGE_RATE, JsonObject.mapFrom(exchangeRate));
    serverResponse(ctx, 200, APPLICATION_JSON, JsonObject.mapFrom(exchangeRate).encodePrettily());
}
Also used : ExchangeRate(org.folio.rest.acq.model.finance.ExchangeRate)

Aggregations

ExchangeRate (org.folio.rest.acq.model.finance.ExchangeRate)2 JsonObject (io.vertx.core.json.JsonObject)1