Skip to content
Snippets Groups Projects

Resolve "Limited capacity lab should display total selected instead of currently enqueued after selection time"

Files

@@ -17,6 +17,7 @@
*/
package nl.tudelft.queue.dto.view.labs;
import java.time.LocalDateTime;
import java.util.Comparator;
import java.util.Map;
import java.util.Optional;
@@ -52,6 +53,13 @@ public class CapacitySessionViewDTO extends QueueSessionViewDTO<CapacitySession>
.sum();
}
/**
* @return Whether the current time is after the selection at time.
*/
public boolean isAfterSelection() {
return capacitySessionConfig.getSelectionAt().isBefore(LocalDateTime.now());
}
public Map<RoomDetailsDTO, Integer> selectedOrPendingCountsPerRoom() {
Map<Long, RoomDetailsDTO> rooms = getSession().getRooms().stream()
.collect(Collectors.toMap(RoomDetailsDTO::getId, Function.identity()));
Loading