Documentation
¶
Index ¶
- Variables
- type BaseEvent
- type CategoriesInfoEvent
- type CategoriesInfoResponse
- type Category
- type CheckProductsRestrictionsEvent
- type CheckProductsRestrictionsRequest
- type CheckProductsRestrictionsResponse
- type CheckProductsRestrictionsResult
- type CheckWorkEvent
- type CheckWorkResponse
- type ChildModifier
- type CreateOrderOnTableEvent
- type CreateOrderOnTableRequest
- type CreateOrderOnTableResponse
- type CreateOrderOnTableResult
- type DefaultSize
- type Discount
- type Dish
- type ErrorBody
- type EventHandler
- type EventInterfaceProvider
- type Expirenza
- func (e *Expirenza) AddHandler(handler interface{}) func()
- func (e *Expirenza) AddHandlerOnce(handler interface{}) func()
- func (e *Expirenza) CategoriesInfo(ctx context.Context, c *CategoriesInfoResponse) error
- func (e *Expirenza) CheckProductsRestrictions(ctx context.Context, c *CheckProductsRestrictionsRequest) (*CheckProductsRestrictionsResponse, error)
- func (e *Expirenza) CheckWork(ctx context.Context, c CheckWorkResponse) error
- func (e *Expirenza) CreateOrderOnTable(ctx context.Context, c *CreateOrderOnTableRequest) (*CreateOrderOnTableResponse, error)
- func (e *Expirenza) GetBill(ctx context.Context, g *GetBillResponse) error
- func (e *Expirenza) HallPlansInfo(ctx context.Context, h *HallPlansInfoResponse) error
- func (e *Expirenza) MenuInfo(ctx context.Context, m *MenuInfoResponse) error
- func (e *Expirenza) Open(ctx context.Context) error
- func (e *Expirenza) PayBill(ctx context.Context, p *PayBillResponse) error
- func (e *Expirenza) Ping() error
- func (e *Expirenza) SplitOrder(ctx context.Context, s *SplitOrderResponse) error
- func (e *Expirenza) StopList(ctx context.Context, s *StopListResponse) error
- func (e *Expirenza) StopSession() error
- func (e *Expirenza) TablesInfo(ctx context.Context, t *TablesInfoResponse) error
- func (e *Expirenza) UsersInfo(ctx context.Context, u *UsersInfoResponse) error
- func (e *Expirenza) VersionInfo(ctx context.Context, v *VersionInfoResponse) error
- type FieldError
- type FiscalData
- type GetBillEvent
- type GetBillResponse
- type Group
- type GroupModifier
- type Guest
- type HallPlan
- type HallPlansInfoEvent
- type HallPlansInfoResponse
- type Item
- type ItemResult
- type List
- type MenuDish
- type MenuInfoEvent
- type MenuInfoResponse
- type MenuModifier
- type Modifier
- type Modifiers
- type Operation
- type Option
- type Order
- type OrderSummary
- type PayBillRequest
- type PayBillResponse
- type Position
- type RootOrder
- type Scale
- type SetSettingsEvent
- type SplitOrderEvent
- type SplitOrderResponse
- type StopListEvent
- type StopListItem
- type StopListResponse
- type SystemInfo
- type Table
- type TablesInfoEvent
- type TablesInfoResponse
- type TerminalGroup
- type UpdateInfo
- type User
- type UsersInfoEvent
- type UsersInfoResponse
- type VersionInfoEvent
- type VersionInfoResponse
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidResponseBody = errors.New("invalid response body")
ErrInvalidResponseBody is returned when the response body is not valid.
Functions ¶
This section is empty.
Types ¶
type BaseEvent ¶
BaseEvent - Базовий запит
func (*BaseEvent) GetOperation ¶
GetOperation - Отримання типу запиту
type CategoriesInfoEvent ¶ added in v0.5.0
type CategoriesInfoEvent struct {
*BaseEvent
}
CategoriesInfoEvent - Запит на отримання списку категорій
type CategoriesInfoResponse ¶ added in v0.5.0
type CheckProductsRestrictionsEvent ¶ added in v0.5.0
CheckProductsRestrictionsEvent - Запит на перевірку наявності блюд
type CheckProductsRestrictionsResponse ¶ added in v0.5.0
type CheckProductsRestrictionsResponse struct {
RID string `json:"rID"`
Result CheckProductsRestrictionsResult `json:"result"`
}
type CheckProductsRestrictionsResult ¶ added in v0.5.0
type CheckProductsRestrictionsResult struct {
CheckResult string `json:"checkResult"`
ItemResults []ItemResult `json:"itemResults"`
}
type CheckWorkEvent ¶ added in v0.5.0
type CheckWorkEvent struct {
*BaseEvent
}
CheckWorkEvent - Запит на перевірку роботи ресторану
type CheckWorkResponse ¶
type ChildModifier ¶ added in v0.5.0
type ChildModifier struct {
DefaultAmount int `json:"defaultAmount"`
ID string `json:"id"`
MaxAmount int `json:"maxAmount"`
MinAmount int `json:"minAmount"`
Required bool `json:"required"`
}
Types for MenuInfoEvent response
type CreateOrderOnTableEvent ¶ added in v0.5.0
type CreateOrderOnTableEvent struct {
*BaseEvent
ExternalID string `json:"externalId"`
OriginName string `json:"originName"`
TableID string `json:"tableId"`
Items []*Item `json:"items"`
FiscalData []*FiscalData `json:"fiscalData"`
}
CreateOrderOnTableEvent - Запит на створення замовлення на столі
type CreateOrderOnTableResponse ¶ added in v0.5.0
type CreateOrderOnTableResponse struct {
RID string `json:"rID"`
Result CreateOrderOnTableResult `json:"result"`
}
type CreateOrderOnTableResult ¶ added in v0.5.0
type CreateOrderOnTableResult struct {
Success bool `json:"success"`
Stage string `json:"stage"`
RootOrder RootOrder `json:"rootOrder"`
OrdersSummary []OrderSummary `json:"ordersSummary"`
Guests []Guest `json:"guests"`
}
type DefaultSize ¶ added in v0.5.0
type DefaultSize struct {
ID string `json:"id"`
KitchenName string `json:"kitchenName"`
MenuIndex int `json:"menuIndex"`
Name string `json:"name"`
}
Types for MenuInfoEvent response
type Dish ¶ added in v0.5.0
type Dish struct {
Category string `json:"category"`
CategoryID string `json:"categoryId"`
CheckNumber string `json:"checkNumber"`
Count float64 `json:"count"`
DishID string `json:"dishId"`
LinkedTo string `json:"linkedTo"`
Name string `json:"name"`
OrderNumber int `json:"orderNumber"`
PositionID string `json:"positionId"`
Sum float64 `json:"sum"`
TaxCategory string `json:"taxCategory"`
TaxCategoryID string `json:"taxCategoryId"`
Type string `json:"type"`
}
Dish - обʼєкт страви
type ErrorBody ¶
type ErrorBody struct {
ErrCode interface{} `json:"errCode"`
ErrText string `json:"errText"`
ErrTitle string `json:"errTitle"`
ErrType string `json:"errType"`
FieldErrors []*FieldError `json:"fieldErrors"`
}
type EventHandler ¶
type EventInterfaceProvider ¶
type EventInterfaceProvider interface {
Type() Operation
New() interface{}
}
type Expirenza ¶
type Expirenza struct {
// contains filtered or unexported fields
}
func NewExpirenzaClient ¶
NewExpirenzaClient - Створення нового клієнта для Expirenza aka ShakeToPay API
func (*Expirenza) AddHandler ¶
func (e *Expirenza) AddHandler(handler interface{}) func()
AddHandler adds an event handler that will be fired every time
func (*Expirenza) AddHandlerOnce ¶
func (e *Expirenza) AddHandlerOnce(handler interface{}) func()
AddHandlerOnce adds an event handler that will be fired the next time once
func (*Expirenza) CategoriesInfo ¶ added in v0.5.0
func (e *Expirenza) CategoriesInfo(ctx context.Context, c *CategoriesInfoResponse) error
func (*Expirenza) CheckProductsRestrictions ¶ added in v0.5.0
func (e *Expirenza) CheckProductsRestrictions(ctx context.Context, c *CheckProductsRestrictionsRequest) (*CheckProductsRestrictionsResponse, error)
CheckProductsRestrictions - Перевірка обмежень на продукти
func (*Expirenza) CheckWork ¶
func (e *Expirenza) CheckWork(ctx context.Context, c CheckWorkResponse) error
CheckWork - відправляє інформацію про готовність до роботи.
func (*Expirenza) CreateOrderOnTable ¶ added in v0.5.0
func (e *Expirenza) CreateOrderOnTable(ctx context.Context, c *CreateOrderOnTableRequest) (*CreateOrderOnTableResponse, error)
CreateOrderOnTable - Створення та оплата замовлення на столі
func (*Expirenza) GetBill ¶ added in v0.5.0
func (e *Expirenza) GetBill(ctx context.Context, g *GetBillResponse) error
GetBill - відправляє інформацію про рахунок.
func (*Expirenza) HallPlansInfo ¶
func (e *Expirenza) HallPlansInfo(ctx context.Context, h *HallPlansInfoResponse) error
HallPlansInfo - відправляє інформацію про план залу.
func (*Expirenza) MenuInfo ¶ added in v0.5.0
func (e *Expirenza) MenuInfo(ctx context.Context, m *MenuInfoResponse) error
MenuInfo - відправляє інформацію про меню.
func (*Expirenza) Open ¶
Open - Відкриття сесії При відкритті сесії відбувається підключення до WebSocket сервера та запуск прослуховування подій
func (*Expirenza) PayBill ¶ added in v0.5.0
func (e *Expirenza) PayBill(ctx context.Context, p *PayBillResponse) error
PayBill - відправляє інформацію про оплату рахунку.
func (*Expirenza) SplitOrder ¶ added in v0.5.0
func (e *Expirenza) SplitOrder(ctx context.Context, s *SplitOrderResponse) error
func (*Expirenza) StopList ¶ added in v0.5.0
func (e *Expirenza) StopList(ctx context.Context, s *StopListResponse) error
StopList - відправляє інформацію про стоп-лист страв.
func (*Expirenza) StopSession ¶
StopSession - Закриття підключення
func (*Expirenza) TablesInfo ¶
func (e *Expirenza) TablesInfo(ctx context.Context, t *TablesInfoResponse) error
TablesInfo - відправляє інформацію про столи.
func (*Expirenza) UsersInfo ¶
func (e *Expirenza) UsersInfo(ctx context.Context, u *UsersInfoResponse) error
UsersInfo - відправляє інформацію про персонал.
func (*Expirenza) VersionInfo ¶ added in v0.5.0
func (e *Expirenza) VersionInfo(ctx context.Context, v *VersionInfoResponse) error
VersionInfo - відправляє інформацію про версію плагіну.
type FieldError ¶
type FiscalData ¶
type GetBillEvent ¶ added in v0.5.0
type GetBillEvent struct {
*BaseEvent
BillID string `json:"billId,omitempty"`
TableNumber string `json:"tableNumber,omitempty"`
}
GetBillEvent - Запит на отримання рахунку
type GetBillResponse ¶ added in v0.5.0
type Group ¶ added in v0.5.0
type Group struct {
ID string `json:"id"`
MenuIndex int `json:"menuIndex"`
Name string `json:"name"`
ParentID string `json:"parentId"`
}
Types for MenuInfoEvent response
type GroupModifier ¶ added in v0.5.0
type GroupModifier struct {
ChildModifiers []ChildModifier `json:"childModifiers"`
ChildModifiersHaveMinMaxRestrictions bool `json:"childModifiersHaveMinMaxRestrictions"`
DefaultAmount int `json:"defaultAmount"`
Free bool `json:"free"`
FreeAmount int `json:"freeAmount"`
ID string `json:"id"`
MaxAmount int `json:"maxAmount"`
MinAmount int `json:"minAmount"`
Required bool `json:"required"`
}
Types for MenuInfoEvent response
type HallPlansInfoEvent ¶ added in v0.5.0
type HallPlansInfoEvent struct {
*BaseEvent
}
HallPlansInfoEvent - Запит на отримання переліку залів у ресторані
type HallPlansInfoResponse ¶
type HallPlansInfoResponse struct {
HallPlans []*HallPlan `json:"hallPlans"`
RID string `json:"rID"`
}
HallPlansInfoResponse is a response to the HallPlansInfo method.
type Item ¶
type Item struct {
ID string `json:"id"`
Quantity float64 `json:"quantity"`
Modifier []*Modifier `json:"modifier,omitempty"`
}
Item - обʼєкт в меню
type ItemResult ¶ added in v0.5.0
type MenuDish ¶ added in v0.5.0
type MenuDish struct {
Category string `json:"category"`
CategoryID string `json:"categoryId"`
Description string `json:"description"`
GroupID string `json:"groupId"`
GroupModifiers []GroupModifier `json:"groupModifiers"`
ID string `json:"id"`
IsActive bool `json:"isActive"`
MenuSections []string `json:"menuSections"`
ModifierSchemeID string `json:"modifierSchemeId"`
Modifiers []Modifier `json:"modifiers"`
Name string `json:"name"`
Price float64 `json:"price"`
Scale Scale `json:"scale"`
TaxCategory string `json:"taxCategory"`
TaxCategoryID string `json:"taxCategoryId"`
Type string `json:"type"`
Unit string `json:"unit"`
VendorCode string `json:"vendorCode"`
}
Types for MenuInfoEvent response
type MenuInfoEvent ¶ added in v0.5.0
type MenuInfoEvent struct {
*BaseEvent
}
MenuInfoEvent - Запит на отримання меню ресторану
type MenuInfoResponse ¶ added in v0.5.3
type MenuInfoResponse struct {
// Dishes - Страви
Dishes []MenuDish `json:"dishes"`
// GroupModifiers - групи модифікаторів страв
GroupModifiers []GroupModifier `json:"groupModifiers"`
// Groups - розділи меню
Groups []Group `json:"groups"`
// HostTerminalsGroup -
HostTerminalsGroup TerminalGroup `json:"hostTerminalsGroup"`
// Modifiers - модифікатори страв
Modifiers []MenuModifier `json:"modifiers"`
RID string `json:"rID"`
// TerminalsGroups -
TerminalsGroups []TerminalGroup `json:"terminalsGroups"`
}
type MenuModifier ¶ added in v0.5.0
type MenuModifier struct {
Category string `json:"category"`
CategoryID string `json:"categoryId"`
Description string `json:"description"`
GroupID string `json:"groupId"`
ID string `json:"id"`
IsActive bool `json:"isActive"`
Name string `json:"name"`
Price float64 `json:"price"`
Scale Scale `json:"scale"`
TaxCategory string `json:"taxCategory"`
TaxCategoryID string `json:"taxCategoryId"`
Unit string `json:"unit"`
VendorCode string `json:"vendorCode"`
}
Types for MenuInfoEvent response
type Modifier ¶
type Modifier struct {
ID string `json:"id"`
GroupID string `json:"groupId"`
Quantity int `json:"quantity"`
}
Modifier - обʼєкт модифікатора
type Operation ¶
type Operation string
const ( // OperationGetBill - Отримання рахунку за номером стола OperationGetBill Operation = "getBill" // OperationPayBill - Оплата рахунку і закриття замовлення OperationPayBill Operation = "payBill" // OperationCreateOrderOnTable - Створення замовлення на столі OperationCreateOrderOnTable Operation = "createOrderOnTable" // OperationCheckProductsRestrictions - Перевірка наявності блюд OperationCheckProductsRestrictions Operation = "checkProductsRestrictions" // OperationSplitOrder - Розділення рахунку (Split Bill) OperationSplitOrder Operation = "splitOrder" // OperationTablesInfo - Отримання інформації про столи ресторану OperationTablesInfo Operation = "tablesInfo" // OperationUsersInfo - Отримання списку персоналу OperationUsersInfo Operation = "usersInfo" // OperationCategoriesInfo - Отримання списку категорій OperationCategoriesInfo Operation = "categoriesInfo" // OperationHallPlansInfo - Отримання переліку залів у ресторані OperationHallPlansInfo Operation = "hallplansInfo" // OperationCheckWork - Перевірка роботи ресторану OperationCheckWork Operation = "checkWork" // OperationSetSettings - Передача налаштувань OperationSetSettings Operation = "setSettings" // OperationStopList - отримання відповіді від ресторану про продукти, що знаходяться в стоп-листі OperationStopList Operation = "stopList" // OperationVersionInfo отримання версії плагіну від ресторану OperationVersionInfo Operation = "versionInfo" // OperationMenuInfo - Отримання меню ресторану OperationMenuInfo Operation = "menuInfo" )
type Option ¶ added in v0.6.0
type Option func(*Expirenza)
func WithHTTPClient ¶ added in v0.6.0
func WithWSClient ¶ added in v0.6.0
func WithWSClient(client *wss.WebsocketClient) Option
type Order ¶ added in v0.5.0
type Order struct {
BillID string `json:"billId"`
BonusSum float64 `json:"bonusSum"`
Created string `json:"created"`
// Discounts - TODO: Ask expirenza developer what exactly fields in this struct object
// Right now we don't know what fields in this struct object
Discounts Discount `json:"discounts"`
Guests []Guest `json:"guests"`
IsBanquetOrder bool `json:"isBanquetOrder"`
IsDelivery bool `json:"isDelivery"`
OrderNumber int `json:"orderNumber"`
PaymentType string `json:"paymentType"`
PricingTime string `json:"pricingTime"`
RawSum int `json:"rawSum"`
RootBillID string `json:"rootBillId"`
SplitAvailable bool `json:"splitAvailable"`
State string `json:"state"`
TableID string `json:"tableId"`
TotalSum float64 `json:"totalSum"`
Waiter string `json:"waiter"`
WaiterID string `json:"waiterId"`
}
Order - обʼєкт замовлення
type OrderSummary ¶ added in v0.5.0
type OrderSummary struct {
OrderID string `json:"orderId"`
OrderNumber int `json:"orderNumber"`
ResultSum float64 `json:"resultSum"`
OrderStatus string `json:"orderStatus"`
Closed string `json:"closed"`
TableNumber int `json:"tableNumber"`
WaiterID string `json:"waiterId"`
Waiter string `json:"waiter"`
}
OrderSummary - обʼєкт замовлення
type PayBillRequest ¶
type PayBillRequest struct {
*BaseEvent
BillID string `json:"billId,omitempty"`
Sum float64 `json:"sum"`
Tips float64 `json:"tips,omitempty"`
FiscalData []*FiscalData `json:"fiscalData"`
}
PayBillRequest - Запит на оплату рахунку
type PayBillResponse ¶ added in v0.5.0
type PayBillResponse struct {
BillID string `json:"billId"`
Guests Guest `json:"guests"`
OrderNumber int `json:"orderNumber"`
RID string `json:"rID"`
StackTraceMessage string `json:"stackTraceMessage"`
State string `json:"state"`
SubState string `json:"substate"`
Waiter string `json:"waiter"`
WaiterID string `json:"waiterId"`
}
type Scale ¶ added in v0.5.0
type Scale struct {
DefaultSize DefaultSize `json:"defaultSize"`
ID string `json:"id"`
Name string `json:"name"`
}
Types for MenuInfoEvent response
type SetSettingsEvent ¶ added in v0.5.0
type SetSettingsEvent struct {
*BaseEvent
PrintPreCheckQr bool `json:"printPrecheckQr"`
PreCheckQrURL string `json:"precheckQrUrl"`
MessageBeforeQr string `json:"messageBeforeQr"`
MessageAfterQr string `json:"messageAfterQr"`
PrintDeliveryPreCheckQr bool `json:"printDeliveryPrecheckQr"`
Settings Modifiers `json:"settings"`
BonusPaymentTypes []interface{} `json:"-"`
BonusUsage bool `json:"bonusUsage"`
PaymentAllowed bool `json:"paymentAllowed"`
}
SetSettingsEvent - Запит на передачу налаштувань
type SplitOrderEvent ¶ added in v0.5.0
type SplitOrderEvent struct {
*BaseEvent
BillID string `json:"billId"`
ControlSum float64 `json:"controlSum"`
Positions []*Position `json:"positions"`
}
SplitOrderEvent - Запит на розділення рахунку
type SplitOrderResponse ¶ added in v0.5.0
type StopListEvent ¶ added in v0.5.0
type StopListEvent struct {
*BaseEvent
}
StopListEvent - Запит на отримання відповіді від ресторану про продукти, що знаходяться в стоп-листі
type StopListItem ¶ added in v0.5.0
type StopListResponse ¶ added in v0.5.0
type SystemInfo ¶ added in v0.5.0
type SystemInfo struct {
AskCashierForMultiCashRegisterPayment bool `json:"AskCashierForMultiCashRegisterPayment"`
HostTerminalName string `json:"HostTerminalName"`
IsRoundingDownOrderSum bool `json:"IsRoundingDownOrderSum"`
// AdditionalInfo - TODO: ?
AdditionalInfo any `json:"additionalInfo"`
IsMain bool `json:"isMain"`
}
type Table ¶
type Table struct {
ID string `json:"id"`
Name string `json:"name"`
HallPlanID string `json:"hallPlanId"`
Number int `json:"number"`
}
Table - обʼєкт столика
type TablesInfoEvent ¶ added in v0.5.0
type TablesInfoEvent struct {
*BaseEvent
}
TablesInfoEvent - Запит на отримання інформації про столи ресторану
type TablesInfoResponse ¶
type TerminalGroup ¶ added in v0.5.0
Types for MenuInfoEvent response
type UpdateInfo ¶ added in v0.5.0
type User ¶
type User struct {
ID string `json:"id"`
CellPhone string `json:"cellPhone"`
Name string `json:"name"`
Roles string `json:"roles"`
}
User - обʼєкт користувача
type UsersInfoEvent ¶ added in v0.5.0
type UsersInfoEvent struct {
*BaseEvent
}
UsersInfoEvent - Запит на отримання списку персоналу
type UsersInfoResponse ¶
type VersionInfoEvent ¶ added in v0.5.0
type VersionInfoEvent struct {
*BaseEvent
}
VersionInfoEvent - Запит на отримання версії плагіну від ресторану
type VersionInfoResponse ¶ added in v0.5.0
type VersionInfoResponse struct {
// AdditionalInfo - TODO: ?
AdditionalInfo any `json:"additionalInfo"`
PartnerID string `json:"partner.id"`
PluginCompilationTimestamp string `json:"plugin.compilation.timestamp"`
PluginVersion string `json:"plugin.version"`
RID string `json:"rID"`
RestaurantLicenseDateEnd string `json:"restaurant.license.date.end"`
RestaurantVersion string `json:"restaurant.version"`
SystemInfo SystemInfo `json:"systemInfo"`
UpdateInfo []UpdateInfo `json:"updateInfo"`
}
