use of alfio.manager.system.ConfigurationManager in project alf.io by alfio-event.
the class AdminWaitingQueueApiController method loadStatus.
private Map<String, Boolean> loadStatus(Event event) {
ZonedDateTime now = ZonedDateTime.now(event.getZoneId());
List<SaleableTicketCategory> stcList = eventManager.loadTicketCategories(event).stream().filter(tc -> !tc.isAccessRestricted()).map(tc -> new SaleableTicketCategory(tc, "", now, event, ticketReservationManager.countAvailableTickets(event, tc), tc.getMaxTickets(), null)).collect(Collectors.toList());
boolean active = EventUtil.checkWaitingQueuePreconditions(event, stcList, configurationManager, eventStatisticsManager.noSeatsAvailable());
boolean paused = active && configurationManager.getBooleanConfigValue(Configuration.from(event.getOrganizationId(), event.getId(), STOP_WAITING_QUEUE_SUBSCRIPTIONS), false);
Map<String, Boolean> result = new HashMap<>();
result.put("active", active);
result.put("paused", paused);
return result;
}
Aggregations