use of org.incode.platform.dom.document.integtests.demo.dom.invoice.DemoInvoice in project estatio by estatio.
the class RenderModelFactoryOfDocumentAttachedToDemoInvoice method doNewRendererModel.
@Override
protected Object doNewRendererModel(final DocumentTemplate documentTemplate, final Document document) {
final List<Paperclip> paperclips = paperclipRepository.findByDocument(document);
final DemoInvoice demoInvoice = paperclips.stream().map(Paperclip::getAttachedTo).filter(DemoInvoice.class::isInstance).map(DemoInvoice.class::cast).findFirst().get();
return new DataModel(demoInvoice.getCustomer(), demoInvoice);
}
Aggregations