This commit is contained in:
Tomáš Dvořák
2025-10-16 13:32:05 +02:00
commit 12cba639b9
663 changed files with 168914 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package models
import (
"time"
)
type EventType string
const (
EventTypeMatch EventType = "match"
EventTypeTraining EventType = "training"
EventTypeMeeting EventType = "meeting"
EventTypeOther EventType = "other"
)
type Event struct {
BaseModel
Title string `json:"title" gorm:"not null"`
Description string `json:"description"`
StartTime time.Time `json:"start_time" gorm:"not null"`
EndTime *time.Time `json:"end_time"`
Location string `json:"location"`
Type EventType `json:"type" gorm:"type:varchar(20);not null;default:'other'"`
CategoryName string `json:"category_name" gorm:"type:varchar(255)"`
IsPublic bool `json:"is_public" gorm:"default:true"`
CreatedByID uint `json:"created_by_id"`
CreatedBy User `json:"created_by" gorm:"foreignKey:CreatedByID"`
ImageURL string `json:"image_url"`
FileURL string `json:"file_url"`
Attachments []EventAttachment `json:"attachments" gorm:"constraint:OnDelete:CASCADE"`
YoutubeURL string `json:"youtube_url" gorm:"type:varchar(500)"`
Latitude *float64 `json:"latitude"`
Longitude *float64 `json:"longitude"`
}
type EventAttachment struct {
BaseModel
EventID uint `json:"event_id" gorm:"index;not null"`
Name string `json:"name"`
URL string `json:"url"`
MimeType string `json:"mime_type"`
Size int64 `json:"size"`
}