database

package
v0.0.0-...-a262b4a Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbConfig

type DbConfig struct {
	Path string
	Db   *gorm.DB
}

func (*DbConfig) InitDatabase

func (d *DbConfig) InitDatabase() error

type Event

type Event struct {
	ID             uint   `gorm:"primaryKey;autoIncrement"`
	Name           string `gorm:"unique"`
	Description    string
	IsPaid         bool
	MaxTicketBatch uint

	PlaceID uint
	Place   Place `gorm:"foreignKey:PlaceID"`

	IsActive bool
}

type Place

type Place struct {
	ID       uint   `gorm:"primaryKey;autoIncrement"`
	Name     string `gorm:"unique"`
	Address  string
	Capacity uint
}

type Ticket

type Ticket struct {
	ID           uint `gorm:"primaryKey"`
	PurchaseTime time.Time
	Status       string

	UserID int64
	User   User `gorm:"foreignKey:UserID"`

	EventID uint
	Event   Event `gorm:"foreignKey:EventID"`
}

type User

type User struct {
	ID          int64 `gorm:"primaryKey"`
	AccessHash  int64
	FirstName   string
	LastName    string
	Role        string
	PhoneNumber string
	IsBoy       bool

	IsFumStudent  bool
	StudentNumber string
	FumFaculty    string

	IsStudent        bool
	IsMashhadStudent bool

	UniversityName string

	EntranceYear string
	IsMastPhd    bool
	StudentMajor string

	IsGraduateStudent bool
	IsStudentRelative bool
}

Jump to

Keyboard shortcuts

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