restaurant

package
v0.0.0-...-87c22ba Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ClientOrder

type ClientOrder struct {
	TableNamber int     `json:"tableNamber"`
	Items       []*Item `json:"items"`
}

type Detail

type Detail struct {
	OrderId    int     `json:"orderId"`
	TotalPrice float64 `json:"totalPrice"`
	WithoutTax float64 `json:"withoutTax"`
	Tips       float64 `json:"tips"`
}

type HttpHandlerFunc

type HttpHandlerFunc http.HandlerFunc

func HttpHandler

func HttpHandler(store *Store) HttpHandlerFunc

type Item

type Item struct {
	ItemId   int `json:"itemId"`
	Quantity int `json:"quantity"`
}
type Menu struct {
	Id        int64  `json:"id"`
	Name      string `json:"name"`
	Price     int    `json:"price"`
	CreatedAt string `json:"created_at"`
}

type Order

type Order struct {
	Id          int `json:"id"`
	TableNamber int `json:"tableNamber"`
}

type Store

type Store struct {
	Db *sql.DB
}

func NewStore

func NewStore(db *sql.DB) *Store

func (*Store) CreateOrder

func (s *Store) CreateOrder(table_number int, items []*Item) (*Detail, error)

func (*Store) ListMenu

func (s *Store) ListMenu() ([]*Menu, error)

Jump to

Keyboard shortcuts

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