use of org.folio.gobi.Mapper in project mod-gobi by folio-org.
the class PostGobiOrdersHelper method mapToPurchaseOrder.
public CompletableFuture<CompositePurchaseOrder> mapToPurchaseOrder(Document doc) {
final OrderMappings.OrderType orderType = getOrderType(doc);
VertxCompletableFuture<CompositePurchaseOrder> future = new VertxCompletableFuture<>(ctx);
lookupOrderMappings(orderType).thenAccept(ordermappings -> {
logger.info("Using Mappings {}", ordermappings);
new Mapper(ordermappings).map(doc, this).thenAccept(future::complete);
}).exceptionally(e -> {
logger.error("Exception looking up Order mappings", e);
future.completeExceptionally(e);
return null;
});
return future;
}
Aggregations