model

package
v0.0.0-...-deb99a2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(key []byte, plaintext string) (string, error)

func AESEncrypt

func AESEncrypt(key []byte, plaintext string) (string, error)

Types

type Card

type Card struct {
	ID         uuid.UUID `gorm:"primarykey;type:uuid;default:(uuid_generate_v4())"`
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  gorm.DeletedAt `gorm:"index"`
	Type       string
	Number     string
	Expiration string
	Address    string
	Address2   string
	City       string
	State      string
	Zip        string
	UserID     uuid.UUID
}

Card struct to describe Card object.

func (*Card) AfterFind

func (c *Card) AfterFind(tx *gorm.DB) (err error)

func (*Card) BeforeSave

func (c *Card) BeforeSave(tx *gorm.DB) (err error)

type Movie

type Movie struct {
	ID             uuid.UUID `gorm:"primarykey;type:uuid;default:(uuid_generate_v4())"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      gorm.DeletedAt `gorm:"index"`
	Title          string
	Category       string
	Cast           string
	Director       string
	Producer       string
	Synopsis       string
	Reviews        string
	TrailerPicture string
	TrailerVideo   string
	RatingCode     string
	ShowTime       time.Time
	Show           []Show `gorm:"foreignKey:MovieID"`
}

Movie struct to describe movie object.

type Order

type Order struct {
	ID              uuid.UUID `gorm:"primarykey;type:uuid;default:(uuid_generate_v4())"`
	CreatedAt       time.Time
	UpdatedAt       time.Time
	DeletedAt       gorm.DeletedAt `gorm:"index"`
	Tickets         []Ticket
	UserID          uuid.UUID
	PromotionID     uuid.UUID
	ShowID          uuid.UUID
	CardID          uuid.UUID
	MovieTitle      string
	TicketPrice     float64
	BookingFeePrice float64
	PromotionPrice  float64
	SalesTaxPrice   float64
	TotalPrice      float64
	CheckOut        bool
}

Order struct to describe order object.

type Promotion

type Promotion struct {
	ID        uuid.UUID `gorm:"primarykey;type:uuid;default:(uuid_generate_v4())"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Discount  float64
	Code      string
}

Promotion struct to describe promotion object.

type Show

type Show struct {
	ID                uuid.UUID `gorm:"primarykey;type:uuid;default:(uuid_generate_v4())" validate:"required"`
	CreatedAt         time.Time
	UpdatedAt         time.Time
	DeletedAt         gorm.DeletedAt `gorm:"index"`
	MovieID           uuid.UUID
	StartTime         time.Time
	EndTime           time.Time
	BookingFee        float64
	AdultTicketPrice  float64
	ChildTicketPrice  float64
	SeniorTicketPrice float64
	TheaterLocation   string
}

Show struct to describe show object.

type Ticket

type Ticket struct {
	ID        uuid.UUID `gorm:"primarykey;type:uuid;default:(uuid_generate_v4())"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Seat      string
	OrderID   uuid.UUID
	ShowID    uuid.UUID
	Type      string
	Price     float64
}

User struct to describe User object.

type User

type User struct {
	ID             uuid.UUID `gorm:"primarykey;type:uuid;default:(uuid_generate_v4())"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      gorm.DeletedAt `gorm:"index"`
	IsActive       bool
	ActivationCode string
	IsAdmin        bool
	UserName       string
	Email          string
	Password       string
	PasswordCode   string
	Name           string
	Phone          string
	Address        string
	Address2       string
	City           string
	State          string
	Zip            string
	NeedPromotion  bool
	Cards          []Card
}

User struct to describe User object.

Jump to

Keyboard shortcuts

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