database

package
v0.0.0-...-1f33363 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddShowsInTheatre

func AddShowsInTheatre(shows *[]models.Show) error

func AddUser

func AddUser(user *models.User) error

AddUser creates a user

func BookSelectedSeats

func BookSelectedSeats(ticket *models.Ticket, ShowSeatIds []uint32) error

func CreateCities

func CreateCities(cities *[]models.City) (*[]models.City, error)

func CreateMovies

func CreateMovies(movies *[]models.Movie) error

func CreateScreens

func CreateScreens(screens *[]models.Screen) error

func CreateSeats

func CreateSeats(seats *[]models.Seat) error

func CreateTheaters

func CreateTheaters(theaters *[]models.Theater) error

func FetchShowSeats

func FetchShowSeats(showSeatIds []uint32) []models.ShowSeat

func GetAllSeatsInTheater

func GetAllSeatsInTheater(theaterId int, screenSeats *[]models.Seat) error

func GetCityTheatres

func GetCityTheatres(cityId uint32, theaters *[]models.Theater) error

func GetMovies

func GetMovies(movies *[]models.Movie) error

func GetShowsForTheatre

func GetShowsForTheatre(theaterId uint32, showSeats *[]models.ShowSeat) error

func GetTicketsForUser

func GetTicketsForUser(emailId string, tickets *[]models.Ticket) error

func GetTotalBookingAmount

func GetTotalBookingAmount(showSeatIds []uint32) float64

func GetUserByEmailID

func GetUserByEmailID(email string) (models.User, error)

func InitDB

func InitDB(config *config.Config)

func ShowCities

func ShowCities(cities *[]models.City) error

func ShowScreens

func ShowScreens(screens *[]models.Screen) error

func ShowTheaters

func ShowTheaters(theaters *[]models.Theater) error

func UpdateShowSeats

func UpdateShowSeats(ticketId uint32, showSeatIds []uint32) bool

func ValidateUserCredentials

func ValidateUserCredentials(email string, password string) (bool, error)

ValidateUserCredentials checks if password is valid for a particular email

Types

type DatabaseInstance

type DatabaseInstance struct {
	Db *gorm.DB
}
var (
	DbInstance *DatabaseInstance
)

func NewDatabaseClient

func NewDatabaseClient(config *config.Config) *DatabaseInstance

func (*DatabaseInstance) CreateTables

func (i *DatabaseInstance) CreateTables()

func (*DatabaseInstance) Ready

func (i *DatabaseInstance) Ready() bool

Jump to

Keyboard shortcuts

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