From 2c484afa14dc48412a1afcf93a54864f3580a989 Mon Sep 17 00:00:00 2001
From: Michael Bauer <michael-bauer@posteo.de>
Date: Wed, 8 May 2024 16:29:04 +0200
Subject: [PATCH] Define statistics queries (by person & by group)

---
 .../coursebook/statistics/statistics.graphql  | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 aleksis/apps/alsijil/frontend/components/coursebook/statistics/statistics.graphql

diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/statistics/statistics.graphql b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/statistics.graphql
new file mode 100644
index 000000000..af610d68d
--- /dev/null
+++ b/aleksis/apps/alsijil/frontend/components/coursebook/statistics/statistics.graphql
@@ -0,0 +1,50 @@
+fragment statistics on StatisticsByPersonType {
+  participationCount
+  absenceCount
+  absenceReasons {
+    id
+    shortName
+    name
+    colour
+    countAsAbsent
+    count
+  }
+  tardinessSum
+  tardinessCount
+  extraMarks {
+    id
+    shortName
+    name
+    colourFg
+    colourBg
+    showInCourseBook
+    count
+  }
+}
+
+query statisticsByPerson (
+  $personId: ID!
+  $termId: ID!
+) {
+  statistics: statisticsByPerson(
+    $personId: ID!
+    $termId: ID!
+  ) {
+  ...statistics
+}
+
+query statisticsByGroup (
+  $groupId: ID!
+  $termId: ID!
+) {
+  statistics: statisticsByGroup(
+    $groupId: ID!
+    $termId: ID!
+  ) {
+  persons {
+    id
+    firstName
+    lastName
+    ...statistics
+  }
+}
-- 
GitLab