models

package
v0.0.0-...-c021965 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Course

type Course struct {
	gorm.Model
	Name  string `json:"name"`
	Par   int    `json:"par"`
	Holes []Hole `json:"holes"`
}

type Hole

type Hole struct {
	gorm.Model
	Number      int `json:"number"`
	Par         int `json:"par"`
	StrokeIndex int `json:"stroke_index"`
	CourseID    uint
}

type HoleScore

type HoleScore struct {
	HoleID      int  `json:"hole_id"`
	Strokes     int  `json:"strokes"`
	ScoreCardID uint `json:"score_card_id"`
}

type Player

type Player struct {
	gorm.Model
	Name      string `json:"name"`
	ProfileID int
	Profile   Profile
	Rounds    []Round `gorm:"many2many:rounds_players;" json:"rounds"`
}

type Profile

type Profile struct {
	Link string `json:"link"`
	ID   int
}

type Round

type Round struct {
	gorm.Model
	Name     string   `json:"name"`
	Players  []Player `gorm:"many2many:rounds_players;" json:"players"`
	Course   Course
	CourseID uint `json:"course_id"`
	Finished bool `gorm:"default:false"`
}

type ScoreCard

type ScoreCard struct {
	gorm.Model
	Name       string `json:"name"`
	Course     Course
	CourseID   uint `json:"course_id"`
	Player     Player
	PlayerID   uint `json:"player_id"`
	Round      Round
	RoundID    uint        `json:"round_id"`
	HoleScores []HoleScore `json:"hole_scores"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL