use of org.incode.module.communications.dom.spi.CommHeaderAbstract in project estatio by estatio.
the class DocumentCommunicationSupportForDocumentsAttachedToDemoInvoice method addTo.
private <T extends CommunicationChannel> void addTo(final DemoInvoice invoice, final CommHeaderAbstract<T> header, final CommunicationChannelType channelType) {
final DemoObjectWithNotes customer = invoice.getCustomer();
final List<CommunicationChannelOwnerLink> links = communicationChannelOwnerLinkRepository.findByOwner(customer);
final List channels = links.stream().map(CommunicationChannelOwnerLink::getCommunicationChannel).filter(cc -> cc.getType() == channelType).collect(Collectors.toList());
header.getToChoices().addAll(channels);
}
Aggregations