entities

package
v0.0.0-...-b5d40b6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 12 Imported by: 0

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"`
	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)

type Booking

type Booking struct {
	Id            string    `gorm:"column:Id"`
	NumberOfSeats uint      `gorm:"column:NumberOfSeats"`
	BookDateTime  time.Time `gorm:"column:BookDateTime"`
	//Status is Enum in case of change
	Status       int       `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

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"`
	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"`
	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 CinemaSeat

type CinemaSeat struct {
	Id         string `gorm:"column:Id"`
	SeatNumber int    `gorm:"column:SeatNumber"`
	//Type is an enum
	Type         int       `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  sql.NullString `gorm:"column:Description"`
	Language     string         `gorm:"column:Language"`
	ReleaseDate  time.Time      `gorm:"column:ReleaseDate"`
	Duration     sql.NullInt32  `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    sql.NullString `gorm:"column:DiscountCouponId"`
	RemoteTransactionId sql.NullString `gorm:"column:RemoteTransactionId"`
	//PaymentMethod is enum
	PaymentMethod int       `gorm:"column:PaymentMethod"`
	BookingId     string    `gorm:"column:BookingId"`
	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

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 sql.NullString `gorm:"column:CancellationReason"`
	IsDeprecated       bool           `gorm:"column:IsDeprecated"`
	CreatedOn          sql.NullTime   `gorm:"column:CreatedOn;autoCreateTime"`
	ModifiedOn         sql.NullTime   `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       int       `gorm:"column:Status"`
	Price        float64   `gorm:"column:Price"`
	CinemaSeatId string    `gorm:"column:CinemaSeatId"`
	ShowId       string    `gorm:"column:ShowId"`
	BookingId    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

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"`
	Email        string         `gorm:"column:Email"`
	PhoneNumber  sql.NullString `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"`
}

func (*User) BeforeCreate

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

func (User) GetId

func (user User) GetId() string

Jump to

Keyboard shortcuts

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