entities

package
v0.0.0-...-285413f Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Id           string                  `gorm:"column:Id"`
	AddressLine  string                  `gorm:"column:AddressLine"`
	EntityId     string                  `gorm:"column:EntityId"`
	CityId       string                  `gorm:"column:CityId"`
	AddressType  enums.EntityAddressType `gorm:"column:AddressType"`
	Coordinates  Coordinate              `gorm:"column:Coordinates"`
	IsCurrent    bool                    `gorm:"column:IsCurrent"`
	IsDeprecated bool                    `gorm:"column:IsDeprecated"`
	CreatedOn    time.Time               `gorm:"index;column:CreatedOn;autoCreateTime"`
	ModifiedOn   time.Time               `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*Address) BeforeCreate

func (address *Address) BeforeCreate(tx *gorm.DB) (err error)

func (Address) GetId

func (address Address) GetId() string

func (Address) TableName

func (Address) TableName() string

type Booking

type Booking struct {
	Id            string              `gorm:"column:Id"`
	NumberOfSeats int                 `gorm:"column:NumberOfSeats"`
	BookDateTime  time.Time           `gorm:"column:BookDateTime"`
	Status        enums.BookingStatus `gorm:"column:Status"`
	UserId        string              `gorm:"column:UserId"`
	ShowId        string              `gorm:"column:ShowId"`
	IsDeprecated  bool                `gorm:"column:IsDeprecated"`
	CreatedOn     time.Time           `gorm:"index;column:CreatedOn;autoCreateTime"`
	ModifiedOn    time.Time           `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*Booking) BeforeCreate

func (booking *Booking) BeforeCreate(tx *gorm.DB) (err error)

func (Booking) GetId

func (booking Booking) GetId() string

func (Booking) TableName

func (Booking) TableName() string

type ByID

type ByID[T IDatabaseEntity] []T

func (ByID[T]) Len

func (byId ByID[T]) Len() int

func (ByID[T]) Less

func (byId ByID[T]) Less(i, j int) bool

func (ByID[T]) Swap

func (byId ByID[T]) Swap(i, j int)

type Cinema

type Cinema struct {
	Id                string       `gorm:"column:Id"`
	Name              string       `gorm:"column:Name"`
	TotalCinemalHalls int          `gorm:"column:TotalCinemalHalls"`
	CityId            string       `gorm:"column:CityId"`
	CinemaHalls       []CinemaHall `gorm:"foreignKey:CinemaId;references:Id;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	IsDeprecated      bool         `gorm:"column:IsDeprecated"`
	CreatedOn         time.Time    `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn        time.Time    `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*Cinema) BeforeCreate

func (cinema *Cinema) BeforeCreate(tx *gorm.DB) (err error)

func (Cinema) GetId

func (cinema Cinema) GetId() string

func (Cinema) TableName

func (Cinema) TableName() string

type CinemaHall

type CinemaHall struct {
	Id           string       `gorm:"column:Id"`
	Name         string       `gorm:"column:Name"`
	TotalSeat    int          `gorm:"column:TotalSeat"`
	CinemaId     string       `gorm:"column:CinemaId"`
	CinemaSeats  []CinemaSeat `gorm:"foreignKey:CinemaHallId;references:Id;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
	IsDeprecated bool         `gorm:"column:IsDeprecated"`
	CreatedOn    time.Time    `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn   time.Time    `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*CinemaHall) BeforeCreate

func (cinemaHall *CinemaHall) BeforeCreate(tx *gorm.DB) (err error)

func (CinemaHall) GetId

func (cinemaHall CinemaHall) GetId() string

func (CinemaHall) TableName

func (CinemaHall) TableName() string

type CinemaRate

type CinemaRate struct {
	Id         string                      `gorm:"column:Id"`
	CinemaId   string                      `gorm:"column:CinemaId"`
	BaseFee    float32                     `gorm:"column:BaseFee"`
	IsActive   bool                        `gorm:"column:IsActive"`
	Discount   utilities.Nullable[float64] `gorm:"column:Discount"`
	IsSpecials utilities.Nullable[bool]    `gorm:"column:IsSpecials"`
	CreatedOn  time.Time                   `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn time.Time                   `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*CinemaRate) BeforeCreate

func (cinemaRate *CinemaRate) BeforeCreate(tx *gorm.DB) (err error)

func (CinemaRate) GetId

func (cinemaRate CinemaRate) GetId() string

func (CinemaRate) TableName

func (CinemaRate) TableName() string

type CinemaSeat

type CinemaSeat struct {
	Id           string         `gorm:"column:Id"`
	SeatNumber   int            `gorm:"column:SeatNumber"`
	Type         enums.SeatType `gorm:"column:Type"`
	CinemaHallId string         `gorm:"column:CinemaHallId"`
	IsDeprecated bool           `gorm:"column:IsDeprecated"`
	CreatedOn    time.Time      `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn   time.Time      `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*CinemaSeat) BeforeCreate

func (cinemaSeat *CinemaSeat) BeforeCreate(tx *gorm.DB) (err error)

func (CinemaSeat) GetId

func (cinemaSeat CinemaSeat) GetId() string

func (CinemaSeat) TableName

func (CinemaSeat) TableName() string

type City

type City struct {
	Id           string     `gorm:"column:Id"`
	Name         string     `gorm:"column:Name"`
	State        string     `gorm:"column:State"`
	Coordinates  Coordinate `gorm:"column:Coordinates"`
	Zipcode      string     `gorm:"column:ZipCode"`
	IsDeprecated bool       `gorm:"column:IsDeprecated"`
	CreatedOn    time.Time  `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn   time.Time  `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*City) BeforeCreate

func (city *City) BeforeCreate(tx *gorm.DB) (err error)

func (City) GetId

func (city City) GetId() string

func (City) TableName

func (City) TableName() string

type Coordinate

type Coordinate struct {
	Longitude float32
	Latitude  float32
}

func (Coordinate) GormDataType

func (coord Coordinate) GormDataType() string

func (Coordinate) GormValue

func (coord Coordinate) GormValue(ctx context.Context, db *gorm.DB) clause.Expr

func (*Coordinate) Scan

func (coord *Coordinate) Scan(v interface{}) error

Scan implements the sql.Scanner interface

type IDatabaseEntity

type IDatabaseEntity interface {
	GetId() string
}

type Movie

type Movie struct {
	Id           string                        `gorm:"column:Id"`
	Title        string                        `gorm:"column:Title"`
	Description  utilities.Nullable[string]    `gorm:"column:Description"`
	Language     string                        `gorm:"column:Language"`
	ReleaseDate  utilities.Nullable[time.Time] `gorm:"column:ReleaseDate"`
	Duration     utilities.Nullable[int]       `gorm:"column:Duration"`
	Genre        int                           `gorm:"column:Genre"`
	Popularity   float32                       `gorm:"column:Popularity"`
	VoteCount    int                           `gorm:"column:VoteCount"`
	IsDeprecated bool                          `gorm:"column:IsDeprecated"`
	CreatedOn    time.Time                     `gorm:"index;column:CreatedOn;autoCreateTime"`
	ModifiedOn   time.Time                     `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*Movie) BeforeCreate

func (movie *Movie) BeforeCreate(tx *gorm.DB) (err error)

func (Movie) GetId

func (movie Movie) GetId() string

func (Movie) TableName

func (Movie) TableName() string

type Payment

type Payment struct {
	Id                       string                     `gorm:"column:Id"`
	Amount                   float64                    `gorm:"column:Amount"`
	PaymentDate              time.Time                  `gorm:"column:PaymentDate"`
	DiscountCouponId         utilities.Nullable[string] `gorm:"column:DiscountCouponId"`
	RemoteTransactionId      utilities.Nullable[string] `gorm:"column:RemoteTransactionId"`
	PaymentMethod            enums.PaymentType          `gorm:"column:PaymentMethod"`
	BookingId                string                     `gorm:"column:BookingId"`
	ProviderExtraInformation utilities.Nullable[string] `gorm:"column:ProviderExtraInformation"`
	IsDeprecated             bool                       `gorm:"column:IsDeprecated"`
	CreatedOn                time.Time                  `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn               time.Time                  `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*Payment) BeforeCreate

func (payment *Payment) BeforeCreate(tx *gorm.DB) (err error)

func (Payment) GetId

func (payment Payment) GetId() string

func (Payment) TableName

func (Payment) TableName() string

type Show

type Show struct {
	Id                 string                     `gorm:"column:Id"`
	Date               time.Time                  `gorm:"column:Date"`
	StartTime          int64                      `gorm:"column:StartTime"`
	EndTime            int64                      `gorm:"column:EndTime"`
	CinemaHallId       string                     `gorm:"column:CinemaHallId"`
	MovieId            string                     `gorm:"column:MovieId"`
	IsCancelled        bool                       `gorm:"column:IsCancelled"`
	CancellationReason utilities.Nullable[string] `gorm:"column:CancellationReason"`
	IsDeprecated       bool                       `gorm:"column:IsDeprecated"`
	CreatedOn          time.Time                  `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn         time.Time                  `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*Show) BeforeCreate

func (show *Show) BeforeCreate(tx *gorm.DB) (err error)

func (Show) GetId

func (show Show) GetId() string

func (Show) TableName

func (Show) TableName() string

type ShowSeat

type ShowSeat struct {
	Id           string                     `gorm:"column:Id"`
	Status       enums.ShowSeatStatus       `gorm:"column:Status"`
	Price        float64                    `gorm:"column:Price"`
	CinemaSeatId string                     `gorm:"column:CinemaSeatId"`
	ShowId       string                     `gorm:"column:ShowId"`
	BookingId    utilities.Nullable[string] `gorm:"column:BookingId"`
	IsDeprecated bool                       `gorm:"column:IsDeprecated"`
	CreatedOn    time.Time                  `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn   time.Time                  `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*ShowSeat) BeforeCreate

func (showSeat *ShowSeat) BeforeCreate(tx *gorm.DB) (err error)

func (ShowSeat) GetId

func (showSeat ShowSeat) GetId() string

func (ShowSeat) TableName

func (ShowSeat) TableName() string

type Tabler

type Tabler interface {
	TableName() string
}

type User

type User struct {
	Id           string                     `gorm:"column:Id"`
	FirstName    string                     `gorm:"column:FirstName"`
	LastName     string                     `gorm:"column:LastName"`
	RoleId       string                     `gorm:"column:RoleId"`
	Email        string                     `gorm:"column:Email"`
	PhoneNumber  utilities.Nullable[string] `gorm:"column:PhoneNumber"`
	Password     string                     `gorm:"column:Password"`
	IsDeprecated bool                       `gorm:"column:IsDeprecated"`
	CreatedOn    time.Time                  `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn   time.Time                  `gorm:"column:ModifiedOn;autoUpdateTime"`
	UserRole     UserRole                   `gorm:"foreignKey:RoleId;references:Id;constraint:OnUpdate:RESTRICT,OnDelete:RESTRICT"`
}

func (*User) BeforeCreate

func (user *User) BeforeCreate(tx *gorm.DB) (err error)

func (*User) BeforeSave

func (user *User) BeforeSave(tx *gorm.DB) (err error)

func (User) GetId

func (user User) GetId() string

func (User) TableName

func (User) TableName() string

type UserRole

type UserRole struct {
	Id          string     `gorm:"column:Id"`
	Name        string     `gorm:"column:Name"`
	Role        enums.Role `gorm:"column:Role"`
	Description string     `gorm:"column:Description"`
	CreatedOn   time.Time  `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn  time.Time  `gorm:"column:ModifiedOn;autoUpdateTime"`
}

func (*UserRole) BeforeCreate

func (userRole *UserRole) BeforeCreate(tx *gorm.DB) (err error)

func (UserRole) GetId

func (userRole UserRole) GetId() string

func (UserRole) TableName

func (UserRole) TableName() string

Jump to

Keyboard shortcuts

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