use of org.folio.rest.jaxrs.model.InvoiceLine.InvoiceLineStatus.OPEN in project mod-invoice by folio-org.
the class CreateInvoiceEventHandler method prepareInvoiceLinesToSave.
private List<InvoiceLine> prepareInvoiceLinesToSave(String invoiceId, DataImportEventPayload dataImportEventPayload, Map<Integer, PoLine> associatedPoLines) {
List<InvoiceLine> invoiceLines = new JsonArray(dataImportEventPayload.getContext().get(INVOICE_LINES_KEY)).stream().map(JsonObject.class::cast).map(json -> json.mapTo(InvoiceLine.class)).map(invoiceLine -> invoiceLine.withInvoiceId(invoiceId).withInvoiceLineStatus(OPEN)).collect(Collectors.toList());
linkInvoiceLinesToPoLines(invoiceLines, associatedPoLines);
return invoiceLines;
}
Aggregations