use of alfio.model.modification.AdminReservationModification in project alf.io by alfio-event.
the class AdminReservationRequestManager method spread.
private Stream<AdminReservationModification> spread(AdminReservationModification src, boolean single) {
if (single) {
return Stream.of(src);
}
return src.getTicketsInfo().stream().flatMap(ti -> ti.getAttendees().stream().map(a -> Pair.of(a, new AdminReservationModification.TicketsInfo(ti.getCategory(), singletonList(a), ti.isAddSeatsIfNotAvailable(), ti.isUpdateAttendees())))).map(p -> {
AdminReservationModification.Attendee attendee = p.getLeft();
String language = StringUtils.defaultIfBlank(attendee.getLanguage(), src.getLanguage());
CustomerData cd = new CustomerData(attendee.getFirstName(), attendee.getLastName(), attendee.getEmailAddress(), null, language);
return new AdminReservationModification(src.getExpiration(), cd, singletonList(p.getRight()), language, src.isUpdateContactData(), src.getNotification());
});
}
Aggregations