feat: initial daily-timer implementation
This commit is contained in:
98
internal/models/types.go
Normal file
98
internal/models/types.go
Normal file
@@ -0,0 +1,98 @@
|
||||
package models
|
||||
|
||||
type SpeakerStatus string
|
||||
|
||||
const (
|
||||
SpeakerStatusPending SpeakerStatus = "pending"
|
||||
SpeakerStatusSpeaking SpeakerStatus = "speaking"
|
||||
SpeakerStatusDone SpeakerStatus = "done"
|
||||
SpeakerStatusSkipped SpeakerStatus = "skipped"
|
||||
)
|
||||
|
||||
type TimerState struct {
|
||||
Running bool `json:"running"`
|
||||
Paused bool `json:"paused"`
|
||||
CurrentSpeakerID uint `json:"currentSpeakerId"`
|
||||
CurrentSpeaker string `json:"currentSpeaker"`
|
||||
SpeakerElapsed int `json:"speakerElapsed"` // seconds
|
||||
SpeakerLimit int `json:"speakerLimit"` // seconds
|
||||
MeetingElapsed int `json:"meetingElapsed"` // seconds
|
||||
MeetingLimit int `json:"meetingLimit"` // seconds
|
||||
SpeakerOvertime bool `json:"speakerOvertime"`
|
||||
MeetingOvertime bool `json:"meetingOvertime"`
|
||||
Warning bool `json:"warning"`
|
||||
WarningSeconds int `json:"warningSeconds"` // seconds before end for warning
|
||||
TotalSpeakersTime int `json:"totalSpeakersTime"` // sum of all speaker limits
|
||||
SpeakingOrder int `json:"speakingOrder"`
|
||||
TotalSpeakers int `json:"totalSpeakers"`
|
||||
RemainingQueue []QueuedSpeaker `json:"remainingQueue"`
|
||||
AllSpeakers []SpeakerInfo `json:"allSpeakers"`
|
||||
}
|
||||
|
||||
type SpeakerInfo struct {
|
||||
ID uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
TimeLimit int `json:"timeLimit"`
|
||||
Order int `json:"order"`
|
||||
Status SpeakerStatus `json:"status"`
|
||||
}
|
||||
|
||||
type QueuedSpeaker struct {
|
||||
ID uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
TimeLimit int `json:"timeLimit"`
|
||||
Order int `json:"order"`
|
||||
}
|
||||
|
||||
type SessionStats struct {
|
||||
SessionID uint `json:"sessionId"`
|
||||
Date string `json:"date"`
|
||||
TotalDuration int `json:"totalDuration"`
|
||||
MeetingLimit int `json:"meetingLimit"`
|
||||
Overtime bool `json:"overtime"`
|
||||
ParticipantCount int `json:"participantCount"`
|
||||
PresentCount int `json:"presentCount"`
|
||||
AbsentCount int `json:"absentCount"`
|
||||
OvertimeCount int `json:"overtimeCount"`
|
||||
SkippedCount int `json:"skippedCount"`
|
||||
ParticipantStats []ParticipantStats `json:"participantStats"`
|
||||
}
|
||||
|
||||
type ParticipantStats struct {
|
||||
ParticipantID uint `json:"participantId"`
|
||||
Name string `json:"name"`
|
||||
Duration int `json:"duration"`
|
||||
TimeLimit int `json:"timeLimit"`
|
||||
Overtime bool `json:"overtime"`
|
||||
Skipped bool `json:"skipped"`
|
||||
Present bool `json:"present"`
|
||||
SpeakingOrder int `json:"speakingOrder"`
|
||||
}
|
||||
|
||||
type AggregatedStats struct {
|
||||
TotalSessions int `json:"totalSessions"`
|
||||
TotalMeetingTime int `json:"totalMeetingTime"`
|
||||
AverageMeetingTime float64 `json:"averageMeetingTime"`
|
||||
OvertimeSessions int `json:"overtimeSessions"`
|
||||
OvertimePercentage float64 `json:"overtimePercentage"`
|
||||
AverageAttendance float64 `json:"averageAttendance"`
|
||||
ParticipantBreakdown []ParticipantBreakdown `json:"participantBreakdown"`
|
||||
}
|
||||
|
||||
type ParticipantBreakdown struct {
|
||||
ParticipantID uint `json:"participantId"`
|
||||
Name string `json:"name"`
|
||||
SessionsAttended int `json:"sessionsAttended"`
|
||||
TotalSpeakingTime int `json:"totalSpeakingTime"`
|
||||
AverageSpeakingTime float64 `json:"averageSpeakingTime"`
|
||||
OvertimeCount int `json:"overtimeCount"`
|
||||
SkipCount int `json:"skipCount"`
|
||||
AttendanceRate float64 `json:"attendanceRate"`
|
||||
}
|
||||
|
||||
type ExportData struct {
|
||||
ExportedAt string `json:"exportedAt"`
|
||||
Participants []Participant `json:"participants"`
|
||||
Sessions []SessionStats `json:"sessions"`
|
||||
Statistics AggregatedStats `json:"statistics"`
|
||||
}
|
||||
Reference in New Issue
Block a user