restaurant

package
v0.0.0-...-336b3bc Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ClientOrder

type ClientOrder struct {
	Table int          `json:"table"`
	Items []*OrderItem `json:"items"`
}

type HttpHandlerFunc

type HttpHandlerFunc http.HandlerFunc

func HttpHandler

func HttpHandler(store *Store) HttpHandlerFunc
type MenuItem struct {
	Id    int64  `json:"id"`
	Name  string `json:"name"`
	Price int64  `json:"price"`
}

type Order

type Order struct {
	Id                   int     `json:"id"`
	Table                int     `json:"table"`
	Date                 string  `json:"date"`
	TotalPrice           float64 `json:"totalPrice"`
	TotalPriceWithoutTax float64 `json:"totalPriceWithoutTax"`
	RecommendedTip       float64 `json:"recommendedTip"`
}

type OrderItem

type OrderItem struct {
	ItemId   int64 `json:"itemId"`
	Quantity int64 `json:"quantity"`
}

type Store

type Store struct {
	Db *sql.DB
}

func NewStore

func NewStore(db *sql.DB) *Store

func (*Store) AddNewOrder

func (s *Store) AddNewOrder(table int, items []*OrderItem) (*Order, error)

func (*Store) GetMenu

func (s *Store) GetMenu() ([]*MenuItem, error)

Jump to

Keyboard shortcuts

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