models

package
v0.0.0-...-85b5927 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmailValidate

func EmailValidate(email string) error

func PasswordValidate

func PasswordValidate(password string) error

func UsernameValidate

func UsernameValidate(username string) error

Types

type EmailVerification

type EmailVerification struct {
	gorm.Model
	OrganizerID uint      `gorm:"not null"`
	Email       string    `gorm:"size:100;not null;unique" json:"email"`
	Token       string    `gorm:"size:255;not null" json:"token"`
	Sent        bool      `gorm:"default:false"`
	Organizer   Organizer `gorm:"foreignKey:OrganizerID"`
}

func (*EmailVerification) CreateEmailVerData

func (e *EmailVerification) CreateEmailVerData(db *gorm.DB, c *gin.Context, body *EmailVerification) error

type Event

type Event struct {
	gorm.Model
	OrganizerID   uint      `gorm:"not null"`
	Organizer     Organizer `gorm:"foreignKey:OrganizerID"`
	Title         string    `gorm:"size:100;not null"`
	Description   string    `gorm:"type:text;not null"`
	ImageURL      string    `gorm:"size:255"`
	Location      string    `gorm:"type:text"`
	Venue         string    `gorm:"size:100"`
	Date          time.Time `gorm:"type:date;not null"`
	Time          string    `gorm:"size:5;not null"`
	Price         float64   `gorm:"type:decimal(10,2);not null"`
	TicketDetails []Ticket
}

func (*Event) CreateEvent

func (e *Event) CreateEvent(db *gorm.DB, c *gin.Context, event *Event)

func (*Event) DeleteEvent

func (e *Event) DeleteEvent(db *gorm.DB, c *gin.Context, event *Event)

func (*Event) DeletePermanently

func (e *Event) DeletePermanently(db *gorm.DB, c *gin.Context, event *Event)

func (*Event) GetByID

func (e *Event) GetByID(db *gorm.DB, id uint) error

func (*Event) UndoDeleteEvent

func (e *Event) UndoDeleteEvent(db *gorm.DB, c *gin.Context, event *Event)

func (*Event) UpdateEvent

func (e *Event) UpdateEvent(db *gorm.DB, c *gin.Context, event *Event)

type Organizer

type Organizer struct {
	gorm.Model
	Username     string `gorm:"size:50;not null;unique" `
	Email        string `gorm:"size:100;not null;unique" `
	PasswordHash string `gorm:"size:255;not null" json:"-"`
	Password     string `json:"password"`
	IsVerfied    bool   `gorm:"default:false"`
}

func (*Organizer) Create

func (o *Organizer) Create(db *gorm.DB, c *gin.Context, body *Organizer) (*Organizer, error)

func (*Organizer) LoginFunc

func (o *Organizer) LoginFunc(db *gorm.DB, c *gin.Context, body *Organizer) (*Organizer, error)

type Ticket

type Ticket struct {
	gorm.Model
	EventID    uint    `gorm:"not null"`
	Event      Event   `gorm:"foreignKey:EventID"`
	FirstName  string  `gorm:"size:50;not null" json:"first_name"`
	LastName   string  `gorm:"size:50;not null"  json:"last_name"`
	Email      string  `gorm:"size:100;not null"  json:"email"`
	Reference  string  `gorm:"size:400;not null"`
	EventPrice float64 `gorm:"type:decimal(10,2);not null"`
	Paid       bool    `gorm:"default:false"`
	Validated  bool    `gorm:"default:false"`
	BoughtDate time.Time
}

func (*Ticket) CreateTicket

func (t *Ticket) CreateTicket(db *gorm.DB, c *gin.Context, ticket *Ticket)

type TicketDetails

type TicketDetails struct {
	TicketID      uint
	EventName     string
	Organizer     string
	EventDate     string
	EventTime     string
	EventTitle    string
	EventLocation string
	FirstName     string
	LastName      string
	Email         string
	QRCodePath    string
}

type UserCart

type UserCart struct {
	gorm.Model
	EventID    uint    `gorm:"not null"`
	Event      Event   `gorm:"foreignKey:EventID"`
	Quantity   int     `gorm:"not null"`
	TotalPrice float64 `gorm:"type:decimal(10,2);not null"`
}

Jump to

Keyboard shortcuts

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