use of uk.ac.ebi.spot.goci.curation.model.AncestryEventView in project goci by EBISPOT.
the class AncestryEventsViewService method createViews.
@Override
public List<EventView> createViews(Long studyId) {
List<EventView> views = new ArrayList<>();
Collection<Ancestry> ancestryCollection = ancestryRepository.findByStudyId(studyId);
List<DeletedAncestry> deletedAncestryCollection = deletedAncestryRepository.findByStudyId(studyId);
if (!ancestryCollection.isEmpty()) {
ancestryCollection.forEach(ancestry -> {
ancestry.getEvents().forEach(event -> {
String eventName = eventTypeService.translateEventByEventType(event.getEventType());
EventView eventView = new AncestryEventView(eventName, event.getEventDate(), ancestry.getId(), event.getUser().getEmail(), createAncestrySummary(ancestry));
views.add(eventView);
});
});
}
return views;
}
Aggregations