Example #1
0
 @RequestMapping(value = "/events", method = GET)
 public List<EventWithStatistics> getAllEvents(Principal principal) {
   return eventStatisticsManager
       .getAllEventsWithStatistics(principal.getName())
       .stream()
       .sorted()
       .collect(Collectors.toList());
 }
Example #2
0
 @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());
 }
Example #3
0
 @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;
 }
Example #4
0
 @RequestMapping(value = "/events/{eventName}/categories-containing-tickets", method = GET)
 public List<TicketCategoryModification> getCategoriesWithTickets(
     @PathVariable("eventName") String eventName, Principal principal) {
   Event event = loadEvent(eventName, principal);
   return eventStatisticsManager
       .loadTicketCategoriesWithStats(event)
       .stream()
       .filter(tc -> !tc.getTickets().isEmpty())
       .map(
           tc ->
               TicketCategoryModification.fromTicketCategory(
                   tc.getTicketCategory(),
                   ticketCategoryDescriptionRepository.findByTicketCategoryId(tc.getId()),
                   event.getZoneId()))
       .collect(Collectors.toList());
 }