Documentation
¶
Index ¶
- Constants
- func ValidPuljeValues() []string
- type AgeGroup
- type Billettholder
- type BillettholderEmail
- type BillettholderEmailKind
- type BillettholderUsers
- type DBDateTime
- func (dbDateTime DBDateTime) Format(layout string) string
- func (dbDateTime DBDateTime) IsZero() bool
- func (dbDateTime DBDateTime) MarshalJSON() ([]byte, error)
- func (dbDateTime *DBDateTime) Scan(value any) error
- func (dbDateTime DBDateTime) TimeOrZero() time.Time
- func (dbDateTime *DBDateTime) UnmarshalJSON(value []byte) error
- func (dbDateTime DBDateTime) Value() (driver.Value, error)
- type Event
- type EventCardModel
- type EventPlayer
- type EventPlayerRole
- type EventPulje
- type EventStatus
- type EventType
- type Interest
- type InterestLevel
- type Pulje
- type PuljeRow
- type PuljeStatus
- type Runtime
- type User
Constants ¶
View Source
const DBDateTimeNowSQL = "strftime('%Y-%m-%dT%H:%M:%fZ', 'now')"
Variables ¶
This section is empty.
Functions ¶
func ValidPuljeValues ¶
func ValidPuljeValues() []string
Types ¶
type Billettholder ¶
type Billettholder struct {
ID int `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Emails []BillettholderEmail `json:"emails,omitempty"`
TicketTypeId int `json:"ticket_type_id"`
TicketType string `json:"ticket_type"`
IsOver18 bool `json:"is_over_18"`
OrderID int `json:"order_id"`
TicketID int `json:"ticket_id"`
CreatedAt DBDateTime `json:"created_at"`
UpdatedAt DBDateTime `json:"updated_at"`
CreatedByID sql.NullInt64 `json:"created_by_id"`
UpdatedByID sql.NullInt64 `json:"updated_by_id"`
}
type BillettholderEmail ¶
type BillettholderEmail struct {
ID int `json:"id"`
BillettholderID int `json:"billettholder_id"`
Email string `json:"email"`
Kind BillettholderEmailKind `json:"kind"` // See BillettholderEmailKind constants.
CreatedAt DBDateTime `json:"created_at"`
UpdatedAt DBDateTime `json:"updated_at"`
CreatedByID sql.NullInt64 `json:"created_by_id"`
UpdatedByID sql.NullInt64 `json:"updated_by_id"`
}
type BillettholderEmailKind ¶
type BillettholderEmailKind string
const ( BillettholderEmailKindTicket BillettholderEmailKind = "Ticket" BillettholderEmailKindAssociated BillettholderEmailKind = "Associated" BillettholderEmailKindManual BillettholderEmailKind = "Manual" )
func (BillettholderEmailKind) Label ¶
func (kind BillettholderEmailKind) Label() string
type BillettholderUsers ¶
type BillettholderUsers struct {
BillettholderID int `json:"billettholder_id"`
UserID int `json:"user_id"`
InsertedAt DBDateTime `json:"inserted_at"`
}
type DBDateTime ¶
func NewDBDateTime ¶
func NewDBDateTime(value time.Time) DBDateTime
func (DBDateTime) Format ¶
func (dbDateTime DBDateTime) Format(layout string) string
func (DBDateTime) IsZero ¶
func (dbDateTime DBDateTime) IsZero() bool
func (DBDateTime) MarshalJSON ¶
func (dbDateTime DBDateTime) MarshalJSON() ([]byte, error)
func (*DBDateTime) Scan ¶
func (dbDateTime *DBDateTime) Scan(value any) error
func (DBDateTime) TimeOrZero ¶
func (dbDateTime DBDateTime) TimeOrZero() time.Time
func (*DBDateTime) UnmarshalJSON ¶
func (dbDateTime *DBDateTime) UnmarshalJSON(value []byte) error
type Event ¶
type Event struct {
ID string `json:"id"`
Title string `json:"title"`
Intro string `json:"intro"`
Description string `json:"description"`
System string `json:"system"`
EventType EventType `json:"event_type"`
AgeGroup AgeGroup `json:"age_group"`
Runtime Runtime `json:"runtime"`
HostName string `json:"host_name"`
UserID sql.NullInt64 `json:"user_id"`
Email string `json:"email"`
PhoneNumber string `json:"phone_number"`
MaxPlayers int `json:"max_players"`
BeginnerFriendly bool `json:"beginner_friendly"`
CanBeRunInEnglish bool `json:"can_be_run_in_english"`
Notes string `json:"notes"`
Status EventStatus `json:"status"`
CreatedAt DBDateTime `json:"created_at"`
UpdatedAt DBDateTime `json:"updated_at"`
CreatedByID sql.NullInt64 `json:"created_by_id"`
UpdatedByID sql.NullInt64 `json:"updated_by_id"`
StatusChangedByID sql.NullInt64 `json:"status_changed_by_id"`
StatusChangedAt DBDateTime `json:"status_changed_at"`
StatusChangedAction sql.NullString `json:"status_changed_action"`
}
type EventCardModel ¶
type EventCardModel struct {
Id string `json:"id"`
IsPublished bool `json:"is_published"`
Title string `json:"title"`
Intro string `json:"intro"`
Status EventStatus `json:"status"`
System string `json:"system"`
HostName string `json:"host_name"`
EventType EventType `json:"event_type"`
AgeGroup AgeGroup `json:"age_group"`
Runtime Runtime `json:"runtime"`
BeginnerFriendly bool `json:"beginner_friendly"`
CanBeRunInEnglish bool `json:"can_be_run_in_english"`
}
type EventPlayer ¶
type EventPlayer struct {
EventID string `json:"event_id"`
PuljeID string `json:"pulje_id"`
BillettholderID int `json:"billettholder_id"`
Role EventPlayerRole `json:"role"`
InsertedAt DBDateTime `json:"inserted_at"`
}
type EventPlayerRole ¶
type EventPlayerRole string
CREATE TABLE relation_events_players (
event_id TEXT NOT NULL,
pulje_id TEXT NOT NULL,
billettholder_id INTEGER NOT NULL,
role TEXT NOT NULL DEFAULT 'Player' CHECK (role IN ('Player', 'GM')),
-- inserted_at uses the DBDateTimeNowSQL default expression.
inserted_at TEXT,
PRIMARY KEY (billettholder_id, event_id, pulje_id),
FOREIGN KEY (billettholder_id) REFERENCES billettholdere (id),
FOREIGN KEY (event_id) REFERENCES events (id),
FOREIGN KEY (pulje_id) REFERENCES puljer (id)
);
const ( EventPlayerRolePlayer EventPlayerRole = "Player" EventPlayerRoleGM EventPlayerRole = "GM" )
func (EventPlayerRole) Label ¶
func (role EventPlayerRole) Label() string
type EventPulje ¶
type EventStatus ¶
type EventStatus string
const ( EventStatusDraft EventStatus = "Kladd" EventStatusSubmitted EventStatus = "Innsendt" EventStatusApproved EventStatus = "Godkjent" EventStatusArchived EventStatus = "Forkastet" EventStatusPublished EventStatus = "Publisert" )
func (EventStatus) Label ¶
func (status EventStatus) Label() string
type Interest ¶
type Interest struct {
BillettholderId int `json:"billettholder_id"`
EventId string `json:"event_id"`
PuljeId string `json:"pulje_id"`
InterestLevel InterestLevel `json:"interest_level"`
CreatedAt DBDateTime `json:"created_at"`
UpdatedAt DBDateTime `json:"updated_at"`
CreatedByID sql.NullInt64 `json:"created_by_id"`
UpdatedByID sql.NullInt64 `json:"updated_by_id"`
}
type InterestLevel ¶
type InterestLevel string
const ( InterestLevelNone InterestLevel = "" InterestLevelHigh InterestLevel = "Veldig interessert" InterestLevelMedium InterestLevel = "Middels interessert" InterestLevelLow InterestLevel = "Litt interessert" )
func (InterestLevel) Label ¶
func (level InterestLevel) Label() string
func (InterestLevel) Valid ¶
func (level InterestLevel) Valid() bool
type PuljeRow ¶
type PuljeRow struct {
ID Pulje `json:"id"`
Name string `json:"name"`
Status PuljeStatus `json:"status"`
StartAt DBDateTime `json:"start_at"`
EndAt DBDateTime `json:"end_at"`
}
type PuljeStatus ¶
type PuljeStatus string
const ( PuljeStatusOpen PuljeStatus = "open" PuljeStatusNotPublished PuljeStatus = "not_published" PuljeStatusPublished PuljeStatus = "published" PuljeStatusLocked PuljeStatus = "locked" PuljeStatusCompleted PuljeStatus = "completed" )
func (PuljeStatus) Label ¶
func (status PuljeStatus) Label() string
Click to show internal directories.
Click to hide internal directories.