feat: initial daily-timer implementation
This commit is contained in:
72
internal/models/models.go
Normal file
72
internal/models/models.go
Normal file
@@ -0,0 +1,72 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Participant struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
Name string `json:"name" gorm:"not null"`
|
||||
Email string `json:"email,omitempty"`
|
||||
TimeLimit int `json:"timeLimit" gorm:"default:120"` // seconds
|
||||
Order int `json:"order" gorm:"default:0"`
|
||||
Active bool `json:"active" gorm:"default:true"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type Meeting struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
Name string `json:"name" gorm:"not null;default:Daily Standup"`
|
||||
TimeLimit int `json:"timeLimit" gorm:"default:3600"` // total meeting limit in seconds (1 hour)
|
||||
Sessions []MeetingSession `json:"sessions,omitempty" gorm:"foreignKey:MeetingID"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type MeetingSession struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
MeetingID uint `json:"meetingId" gorm:"not null"`
|
||||
StartedAt time.Time `json:"startedAt"`
|
||||
EndedAt *time.Time `json:"endedAt,omitempty"`
|
||||
TotalDuration int `json:"totalDuration"` // seconds
|
||||
Completed bool `json:"completed" gorm:"default:false"`
|
||||
ParticipantLogs []ParticipantLog `json:"participantLogs,omitempty" gorm:"foreignKey:SessionID"`
|
||||
Attendance []SessionAttendance `json:"attendance,omitempty" gorm:"foreignKey:SessionID"`
|
||||
}
|
||||
|
||||
type ParticipantLog struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
SessionID uint `json:"sessionId" gorm:"not null"`
|
||||
ParticipantID uint `json:"participantId" gorm:"not null"`
|
||||
Participant Participant `json:"participant,omitempty" gorm:"foreignKey:ParticipantID"`
|
||||
StartedAt time.Time `json:"startedAt"`
|
||||
EndedAt *time.Time `json:"endedAt,omitempty"`
|
||||
Duration int `json:"duration"` // seconds
|
||||
Skipped bool `json:"skipped" gorm:"default:false"`
|
||||
Overtime bool `json:"overtime" gorm:"default:false"`
|
||||
Order int `json:"order"` // speaking order in session
|
||||
}
|
||||
|
||||
type SessionAttendance struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
SessionID uint `json:"sessionId" gorm:"not null"`
|
||||
ParticipantID uint `json:"participantId" gorm:"not null"`
|
||||
Participant Participant `json:"participant,omitempty" gorm:"foreignKey:ParticipantID"`
|
||||
Present bool `json:"present" gorm:"default:true"`
|
||||
JoinedLate bool `json:"joinedLate" gorm:"default:false"`
|
||||
}
|
||||
|
||||
type Settings struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
DefaultParticipantTime int `json:"defaultParticipantTime" gorm:"default:120"` // seconds
|
||||
DefaultMeetingTime int `json:"defaultMeetingTime" gorm:"default:900"` // seconds
|
||||
SoundEnabled bool `json:"soundEnabled" gorm:"default:true"`
|
||||
SoundWarning string `json:"soundWarning" gorm:"default:warning.mp3"`
|
||||
SoundTimeUp string `json:"soundTimeUp" gorm:"default:timeup.mp3"`
|
||||
SoundMeetingEnd string `json:"soundMeetingEnd" gorm:"default:meeting_end.mp3"`
|
||||
WarningThreshold int `json:"warningThreshold" gorm:"default:30"` // seconds before time up
|
||||
Theme string `json:"theme" gorm:"default:dark"`
|
||||
WindowWidth int `json:"windowWidth" gorm:"default:800"` // minimum 480
|
||||
WindowFullHeight bool `json:"windowFullHeight" gorm:"default:true"` // use full screen height
|
||||
}
|
||||
Reference in New Issue
Block a user