Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
2 files changed, 10 insertions, 1 deletions
-rw-r--r--src/Services/EventService.cpp9
-rw-r--r--src/Services/EventService.h2
diff --git a/src/Services/EventService.cpp b/src/Services/EventService.cpp
index 88a9e08..6388a1e 100644
--- a/src/Services/EventService.cpp
+++ b/src/Services/EventService.cpp
@@ -179,6 +179,15 @@ List<Event> EventService::queryMostWatched(unsigned topN) {
return result;
}
+List<Event> EventService::queryInsufficientlyVisited() {
+ List<Event> result;
+ for (unsigned i = 0; i < events.get_count(); i++) {
+ if (events[i].get_tickets().get_count() < events[i].get_hall().get_rows() * events[i].get_hall().get_seatsPerRow() / 10)
+ result.add(events[i]);
+ }
+ return result;
+}
+
template <typename T>
bool cond_event_all(const Event& e1, T scrap) {
return true;
diff --git a/src/Services/EventService.h b/src/Services/EventService.h
index 1914c02..0a6a399 100644
--- a/src/Services/EventService.h
+++ b/src/Services/EventService.h
@@ -35,7 +35,7 @@ public:
String createSeatingString(const char* name, const Date& date, unsigned* seatsPerRow);
List<Event> queryMostWatched(unsigned topN);
- void queryInsufficientlyVisited();
+ List<Event> queryInsufficientlyVisited();
StatusCode reportReservations(const char* name, const Date& date);
StatusCode reportBoughtTickets(int hallNumber, const Date& start, const Date& end, bool all = false);