Documentation
¶
Index ¶
Constants ¶
const ( TeamEntryRequestPending = "pending" TeamEntryRequestApproved = "approved" TeamEntryRequestRejected = "rejected" )
const ( SuperAdminRole = "super_admin" AdminRole = "admin" MemberRole = "member" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶
type DeletionConfirmation ¶
type ForgotPassword ¶
type Meeting ¶
type Meeting struct { gorm.Model TeamID uint `gorm:"not null"` Title string `gorm:"size:255;not null"` Description string `gorm:"size:255;not null"` Venue string `gorm:"size:255;not null"` Location Location `gorm:"embedded"` StartTime time.Time `gorm:"not null"` // Unix timestamp, for info purposes only. Attendance will start on manual start. MeetingPeriod bool `gorm:"default:false"` AttendancePeriod bool `gorm:"default:false"` // Members can mark attendance while true. Can only be started after meeting has started. Is ended alongside meeting end if not ended before. MeetingOver bool `gorm:"default:false"` // Will not show meeting on dashboard if true, can be seen in some history tab AttendanceOver bool `gorm:"default:false"` }
Members can start marking attendance after meeting has been started (MeetingPeriod = true), and attendance is open (AttendancePeriod = true). Their attendance will be OnTime = true. If they mark attendance after attendance closed (AttendancePeriod = false), but while meeting still ongoing (MeetingPeriod = True), their attendance will be OnTime = false. They cannot mark attendance after meeting has ended (MeetingOver = true), which is set when MeetingPeriod = true -> false. A meeting can only be deleted if MeetingPeriod = false and AttendancePeriod = false and MeetingOver = false. I.e., meeting hasn't started yet.
func (*Meeting) BeforeCreate ¶
add isvalid check to model to check if venue, title, description are not empty strings or missing add isvalid check to model to check if location is valid add isvalid check to model to check if starttime is in the future all this in a beforecreate hook
type MeetingAttendance ¶
type MeetingAttendance struct { gorm.Model UserID uint `gorm:"primaryKey;not null"` MeetingID uint `gorm:"primaryKey;not null"` AttendanceMarkedAt time.Time `gorm:"not null"` OnTime bool }
func (*MeetingAttendance) BeforeCreate ¶
func (ma *MeetingAttendance) BeforeCreate(tx *gorm.DB) error
type PasswordAuth ¶
type PasswordAuth struct { gorm.Model Email string `gorm:"size:255;not null;unique;"` Password string `gorm:"size:255;not null;"` UserID uint `gorm:"unique;"` }
func (*PasswordAuth) HashPassword ¶
func (pa *PasswordAuth) HashPassword() error
type Team ¶
type Team struct { gorm.Model Name string `gorm:"not null;unique"` Description string SuperAdminID uint // Foreign key to the user who is the super admin of this team // Meetings []Meeting Protected bool `gorm:"default:false"` // If true, then users will need to be approved by the super admin to join this team Invite string `gorm:"unique;not null"` // Invite code for this team, length 10 }