85 lines
2.8 KiB
Go
85 lines
2.8 KiB
Go
package contract
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type SelfOrderTableTokenResponse struct {
|
|
SessionID string `json:"session_id"`
|
|
TableID string `json:"table_id"`
|
|
OrganizationID string `json:"organization_id"`
|
|
OutletID string `json:"outlet_id"`
|
|
TableName string `json:"table_name"`
|
|
OutletName string `json:"outlet_name"`
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
type SelfOrderMenuRequest struct {
|
|
SessionID string `form:"session_id" validate:"required"`
|
|
}
|
|
|
|
type SelfOrderMenuResponse struct {
|
|
OutletName string `json:"outlet_name"`
|
|
TableName string `json:"table_name"`
|
|
Categories []SelfOrderMenuCategory `json:"categories"`
|
|
}
|
|
|
|
type SelfOrderMenuCategory struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description,omitempty"`
|
|
Order int `json:"order"`
|
|
Products []SelfOrderMenuItem `json:"products"`
|
|
}
|
|
|
|
type SelfOrderMenuItem struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description,omitempty"`
|
|
Price float64 `json:"price"`
|
|
ImageURL *string `json:"image_url,omitempty"`
|
|
Variants []SelfOrderMenuVariant `json:"variants,omitempty"`
|
|
}
|
|
|
|
type SelfOrderMenuVariant struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
PriceModifier float64 `json:"price_modifier"`
|
|
}
|
|
|
|
type SelfOrderCreateOrderRequest struct {
|
|
SessionID string `json:"session_id" validate:"required"`
|
|
CustomerName string `json:"customer_name" validate:"required"`
|
|
OrderType string `json:"order_type" validate:"required,oneof=dine_in takeaway delivery"`
|
|
OrderItems []SelfOrderCreateOrderItem `json:"order_items" validate:"required,min=1,dive"`
|
|
}
|
|
|
|
type SelfOrderCreateOrderItem struct {
|
|
ProductID uuid.UUID `json:"product_id" validate:"required"`
|
|
ProductVariantID *uuid.UUID `json:"product_variant_id,omitempty"`
|
|
Quantity int `json:"quantity" validate:"required,min=1"`
|
|
Notes *string `json:"notes,omitempty"`
|
|
}
|
|
|
|
type SelfOrderListCategoriesRequest struct {
|
|
OrganizationID string `form:"organization_id" validate:"required"`
|
|
OutletID string `form:"outlet_id" validate:"required"`
|
|
}
|
|
|
|
type SelfOrderCategoryItem struct {
|
|
ID uuid.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description,omitempty"`
|
|
Order int `json:"order"`
|
|
}
|
|
|
|
type SelfOrderListCategoriesResponse struct {
|
|
Categories []SelfOrderCategoryItem `json:"categories"`
|
|
}
|
|
|
|
type SelfOrderListOrdersResponse struct {
|
|
Orders []OrderResponse `json:"orders"`
|
|
}
|
|
|
|
type SelfOrderOrderLineItem = OrderItemResponse
|