@RequestMapping(value = "/events/{eventName}/pending-payments") public List<SerializablePair<TicketReservation, OrderSummary>> getPendingPayments( @PathVariable("eventName") String eventName, Principal principal) { return ticketReservationManager .getPendingPayments( eventStatisticsManager.getSingleEventWithStatistics(eventName, principal.getName())) .stream() .map(SerializablePair::fromPair) .collect(Collectors.toList()); }
@RequestMapping(value = "/events/{name}", method = GET) public Map<String, Object> getSingleEvent( @PathVariable("name") String eventName, Principal principal) { Map<String, Object> out = new HashMap<>(); final String username = principal.getName(); final EventWithStatistics event = eventStatisticsManager.getSingleEventWithStatistics(eventName, username); out.put("event", event); out.put("organization", eventManager.loadOrganizer(event.getEvent(), username)); return out; }