repository

package
v0.0.0-...-4c8948d Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Booking

type Booking struct {
	ID              int64
	CreatedAt       time.Time
	UpdatedAt       sql.NullTime
	DeletedAt       sql.NullTime
	UserID          string
	CourseID        int64
	Golfers         int64
	Datetime        time.Time
	Price           float64
	BookingID       string
	StripePaymentID string
	Status          BookingsStatus
	Confirmed       bool
}

type BookingsStatus

type BookingsStatus string
const (
	BookingsStatusConfirmed BookingsStatus = "confirmed"
	BookingsStatusRequested BookingsStatus = "requested"
)

func (*BookingsStatus) Scan

func (e *BookingsStatus) Scan(src interface{}) error

type CreateBookingParams

type CreateBookingParams struct {
	UserID          string
	CourseID        int64
	Golfers         int64
	Datetime        time.Time
	Price           float64
	BookingID       string
	StripePaymentID string
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetConfirmedBookingsByDateAndCourseParams

type GetConfirmedBookingsByDateAndCourseParams struct {
	CourseID int64
	Datetime time.Time
}

type NullBookingsStatus

type NullBookingsStatus struct {
	BookingsStatus BookingsStatus
	Valid          bool // Valid is true if BookingsStatus is not NULL
}

func (*NullBookingsStatus) Scan

func (ns *NullBookingsStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullBookingsStatus) Value

func (ns NullBookingsStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	CreateBooking(ctx context.Context, arg *CreateBookingParams) (int64, error)
	GetABooking(ctx context.Context, id int64) (Booking, error)
	GetConfirmedBookingsByDateAndCourse(ctx context.Context, arg *GetConfirmedBookingsByDateAndCourseParams) ([]Booking, error)
	ListUserBookings(ctx context.Context, userID string) ([]Booking, error)
	UpdateAndConfirm(ctx context.Context, arg *UpdateAndConfirmParams) error
	UpdateBooking(ctx context.Context, arg *UpdateBookingParams) error
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateBooking

func (q *Queries) CreateBooking(ctx context.Context, arg *CreateBookingParams) (int64, error)

func (*Queries) GetABooking

func (q *Queries) GetABooking(ctx context.Context, id int64) (Booking, error)

func (*Queries) GetConfirmedBookingsByDateAndCourse

func (q *Queries) GetConfirmedBookingsByDateAndCourse(ctx context.Context, arg *GetConfirmedBookingsByDateAndCourseParams) ([]Booking, error)

func (*Queries) ListUserBookings

func (q *Queries) ListUserBookings(ctx context.Context, userID string) ([]Booking, error)

func (*Queries) UpdateAndConfirm

func (q *Queries) UpdateAndConfirm(ctx context.Context, arg *UpdateAndConfirmParams) error

func (*Queries) UpdateBooking

func (q *Queries) UpdateBooking(ctx context.Context, arg *UpdateBookingParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type UpdateAndConfirmParams

type UpdateAndConfirmParams struct {
	StripePaymentID string
	ID              int64
}

type UpdateBookingParams

type UpdateBookingParams struct {
	UserID string
	ID     int64
}

Jump to

Keyboard shortcuts

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