entity

package
v0.0.0-...-0b5441b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID     string  `gorm:"primaryKey"`
	Name   string  `gorm:"not null"`
	Events []Event `gorm:"foreignKey:CategoryID"`
}

type Event

type Event struct {
	ID           string         `gorm:"primaryKey"`
	CategoryID   string         `gorm:"not null"`
	Title        string         `gorm:"not null"`
	Description  string         `gorm:"not null"`
	Tempat       string         `gorm:"not null;default:"Online""`
	Speakers     pq.StringArray `gorm:"not null;type:text[]"`
	SpeakersRole pq.StringArray `gorm:"not null;type:text[]"`
	Date         time.Time      `gorm:"not null"`
	StartAt      time.Time      `gorm:"not null"`
	Link         string
	BannerUrl    string    `gorm:"not null"`
	Price        uint32    `gorm:"not null"`
	TicketQty    uint16    `gorm:"not null"`
	OrganizeBy   string    `gorm:"not null"`
	IsPublic     bool      `gorm:"not null;default:true"`
	Tickets      []Ticket  `gorm:"foreignKey:EventID"`
	Invoices     []Invoice `gorm:"foreignKey:"EventID"`
	CreatedAt    time.Time `gorm:"not null"`
	UpdatedAt    time.Time `gorm:"not null"`
}

type Invoice

type Invoice struct {
	ID        string `gorm:"primaryKey"`
	UserID    string `gorm:"not null"`
	EventID   string `gorm:"not null"`
	Amount    int64  `gorm:"not null;default:0"`
	Status    string `gorm:"not null"`
	Snap      string `gorm:"not null"`
	Ticket    Ticket `gorm:"foreignKey:InvoiceID"`
	Event     Event
	CreatedAt time.Time `gorm:"not null"`
}

type Ticket

type Ticket struct {
	ID        string    `gorm:"primaryKey"`
	UserID    string    `gorm:"not null"`
	InvoiceID string    `gorm:"not null"`
	EventID   string    `gorm:"not null"`
	CreatedAt time.Time `gorm:"not null"`
	Event     Event
	User      User
}

type User

type User struct {
	ID                string `gorm:"primaryKey"`
	Email             string `gorm:"not null;unique"`
	Password          string
	NimNik            string
	FullName          string
	Prodi             string
	Universitas       string
	IsEmailVerified   bool      `gorm:"not null"`
	EmailVerifiedAt   time.Time `gorm:"not null"`
	IsProfileVerified bool      `gorm:"not null"`
	IsAdmin           bool      `gorm:"not null"`
	IsOrganizer       bool      `gorm:"not null"`
	IsBrawijaya       bool      `gorm:"not null;default:false"`
	IDUrl             string    `gorm:"not null"`
	Invoices          []Invoice `gorm:"foreignKey:UserID"`
	Events            []Event   `gorm:"foreignKey:OrganizeBy"`
	Ticekts           []Ticket  `gorm:"foreignKey:UserID"`
}

Jump to

Keyboard shortcuts

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