nquest/pkg/models/game.go
2024-01-28 19:19:41 +00:00

31 lines
640 B
Go

package models
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type Game struct {
ID uuid.UUID `gorm:"primarykey" json:"id"`
Visible bool `gorm:"index"`
Title string
Description string
Tasks []*Task `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
Authors []*User `gorm:"many2many:game_authors"`
Type GameType
Points int
Icon *File
IconID uuid.UUID
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
type GameType int
const (
VirtualGame GameType = iota
CityGame
)