databaseHandler

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Concert

type Concert struct {
	ID                     string  `json:"id"`
	Title                  string  `json:"title"`
	Description            string  `json:"description"`
	ImageURL               string  `json:"imageURL"`
	Location               string  `json:"location"`
	DateTime               *int64  `json:"dateTime,omitempty"`
	Date                   string  `json:"date"`
	Time                   string  `json:"time"`
	TotalTickets           *uint16 `json:"totalTickets,omitempty"`
	TicketsSold            *uint16 `json:"ticketsSold,omitempty"`
	AvailableTickets       uint16  `json:"availableTickets"`
	FullPrice              float32 `json:"fullPrice"`
	ConcessionPrice        float32 `json:"concessionPrice"`
	AdditionalRequiredInfo struct {
		PerTicket   []Field `json:"perTicket"`
		PerPurchase []Field `json:"perPurchase"`
	} `json:"additionalRequiredInfo"`
}

Concert is a model of a concert which contains basic info regarding a concert, taken from dynamoDB

type DatabaseHandler

type DatabaseHandler interface {
	CreateOrderInTable(order paymentHandler.Order) (err error)
	GenerateOrderReference(size uint8) (ref string)
	GetConcertFromTable(concertID string) (concert *Concert, err error)
	GetConcertsFromTable() (concerts []Concert, err error)
	GetOrderFromTable(concertId string, ref string) (order *paymentHandler.Order, err error)
	GetOrdersByOrderReferenceFromTable(ref string) (orders []paymentHandler.Order, err error)
	ReformatDateTimeAndTickets(concert *Concert) (err error)
	UpdateOrderInTable(concertID string, reference string, newStatus string) (err error)
	UpdateTicketsSoldInTable(concertID string, ticketsSold uint16) (err error)
}

type ErrConcertDoesNotExist

type ErrConcertDoesNotExist struct {
	Message string
}

ErrConcertDoesNotExist is a custom error message to signify the concert with a given ID does not exist

func (ErrConcertDoesNotExist) Error

func (e ErrConcertDoesNotExist) Error() string

type ErrConcertInPast

type ErrConcertInPast struct {
	Message string
}

ErrConcertInPast is a custom error message to signify concert is in past and tickets can no longer be purchased for it

func (ErrConcertInPast) Error

func (e ErrConcertInPast) Error() string

type ErrInvalidConcertData

type ErrInvalidConcertData struct {
	Message string
}

ErrInvalidConcertData is a custom error message to signify the data from dynamoDB that has been unmarshalled into a struct is incomplete

func (ErrInvalidConcertData) Error

func (e ErrInvalidConcertData) Error() string

type Field added in v1.0.0

type Field struct {
	Key          string   `json:"key"`
	Question     string   `json:"question"`
	FormType     string   `json:"formType"`
	InputOptions []string `json:"options,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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