add new report handler

This commit is contained in:
Adrian Zürcher
2026-02-10 21:37:00 +01:00
parent 108eae597b
commit c1572c5ec6
4 changed files with 161 additions and 0 deletions

6
models/date.go Normal file
View File

@@ -0,0 +1,6 @@
package models
type Date struct {
From string ` json:"from,omitempty"`
To string ` json:"to,omitempty"`
}

20
models/report.go Normal file
View File

@@ -0,0 +1,20 @@
package models
type ReportFilter struct {
Weekdays Weekdays `json:"weekdays"`
Date Date `json:"date"`
Groups []uint `json:"groupIds,omitempty"`
Name []string `json:"name,omitempty"`
}
type Report struct {
Data map[string]*Data `json:"data,omitempty"`
Attendees []*Member `json:"attendees,omitempty"`
NonAttendees []*Member `json:"nonAttendees,omitempty"`
}
type Data struct {
Minimal int `json:"minimal,omitempty"`
Average int `json:"average,omitempty"`
Maximal int `json:"maximal,omitempty"`
}

11
models/weekdays.go Normal file
View File

@@ -0,0 +1,11 @@
package models
type Weekdays struct {
Monday bool `json:"monday,omitempty"`
Tuesday bool `json:"tuesday,omitempty"`
Wednesday bool `json:"wednesday,omitempty"`
Thursday bool `json:"thursday,omitempty"`
Friday bool `json:"friday,omitempty"`
Saturday bool `json:"saturday,omitempty"`
Sunday bool `json:"sunday,omitempty"`
}