mobileorder

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID       int `json:"id"`
	CampusID int `json:"campus_id"`
}

type Acknowledgement

type Acknowledgement struct {
	Accepted bool `json:"accepted"`
}

type Campus

type Campus struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	City     string `json:"city"`
	Timezone string `json:"timezone"`
}

type Cart

type Cart struct {
	LocationID        int         `json:"location_id"`
	Fulfillment       Fulfillment `json:"fulfillment"`
	PaymentMethod     *int        `json:"payment_method"`
	TenderID          int         `json:"tender_id"`
	SecondaryTenderID int         `json:"secondary_tender_id"`
	Date              *string     `json:"date"`
	Time              *string     `json:"time"`
	PickupSpotID      int         `json:"pickup_spot_id"`
	Comment           string      `json:"comment"`
	CheckoutChoices   []int       `json:"checkout_choices"`
	Items             []CartItem  `json:"items"`
}

func ReadCart

func ReadCart(r io.Reader) (Cart, error)

type CartItem

type CartItem struct {
	ItemID       int          `json:"itemid"`
	SectionID    int          `json:"sectionid"`
	MealExchange bool         `json:"meal_ex_applied"`
	Options      []CartOption `json:"options"`
}

type CartOption

type CartOption struct {
	ID     int         `json:"optionid"`
	Values []CartValue `json:"values"`
}

type CartSelection

type CartSelection struct {
	Cart    Cart
	ItemIDs []int

	Choices []string
}

type CartValue

type CartValue struct {
	ID          int        `json:"valueid"`
	ComboItemID int        `json:"combo_itemid"`
	ComboItems  []CartItem `json:"combo_items"`
}

type CheckoutOptions

type CheckoutOptions struct {
	LocationID          int             `json:"location_id"`
	Status              string          `json:"status"`
	Instructions        string          `json:"instructions,omitempty"`
	CommentRequired     bool            `json:"comment_required"`
	CommentInstructions string          `json:"comment_instructions,omitempty"`
	Dates               json.RawMessage `json:"dates"`
	Times               json.RawMessage `json:"times"`
	Tenders             json.RawMessage `json:"tenders"`
	PickupSpots         json.RawMessage `json:"pickup_spots"`
	Questions           json.RawMessage `json:"questions"`
}

type Client

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

func New

func New() *Client

func Open

func Open(ctx context.Context, options auth.Options) (*Client, error)

func (*Client) Account

func (c *Client) Account(ctx context.Context) (*Account, error)

func (*Client) BuildCart

func (c *Client) BuildCart(ctx context.Context, s CartSelection) (*Cart, error)

func (*Client) Campuses

func (c *Client) Campuses(ctx context.Context) ([]Campus, error)

func (*Client) CancelOrder

func (c *Client) CancelOrder(ctx context.Context, id int) (*Acknowledgement, error)

func (*Client) CheckInOrder

func (c *Client) CheckInOrder(ctx context.Context, id int, barcode string) (*Acknowledgement, error)

func (*Client) CheckoutOptions

func (c *Client) CheckoutOptions(ctx context.Context, o MenuOptions) (*CheckoutOptions, error)

func (*Client) ContinueOrder

func (c *Client) ContinueOrder(ctx context.Context, id int) (*OrderProgress, error)

func (*Client) Item

func (c *Client) Item(ctx context.Context, o MenuOptions, id int) (*Item, error)

func (*Client) Locations

func (c *Client) Locations(ctx context.Context) ([]Location, error)

func (*Client) Menu

func (c *Client) Menu(ctx context.Context, o MenuOptions) (*Menu, error)

func (*Client) Orders

func (c *Client) Orders(ctx context.Context, pending bool) ([]Order, error)

func (*Client) PaymentMethods

func (c *Client) PaymentMethods(ctx context.Context) ([]PaymentMethod, error)

func (*Client) PlaceOrder

func (c *Client) PlaceOrder(ctx context.Context, cart Cart, expectedTotal int) (*OrderProgress, error)

func (*Client) Quote

func (c *Client) Quote(ctx context.Context, cart Cart) (*Quote, error)

func (*Client) USC

func (c *Client) USC(ctx context.Context) (*Campus, error)

type FlatMenu

type FlatMenu struct {
	Status     string         `json:"status"`
	LocationID int            `json:"location_id"`
	Items      []FlatMenuItem `json:"items"`
}

type FlatMenuItem

type FlatMenuItem struct {
	MenuItem
	SectionID        int    `json:"section_id"`
	Section          string `json:"section"`
	SectionAvailable bool   `json:"section_available"`
}

type Fulfillment

type Fulfillment string
const (
	Pickup   Fulfillment = "pickup"
	Delivery Fulfillment = "delivery"
	Address  Fulfillment = "address"
)

type Item

type Item struct {
	MenuItem
	SectionID   int          `json:"section_id"`
	Description string       `json:"description,omitempty"`
	Options     []ItemOption `json:"options"`
}

type ItemOption

type ItemOption struct {
	ID            int         `json:"id"`
	Name          string      `json:"name"`
	Minimum       int         `json:"minimum"`
	Maximum       int         `json:"maximum"`
	AllowQuantity bool        `json:"allow_quantity"`
	Values        []ItemValue `json:"values"`
}

type ItemValue

type ItemValue struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Price       int    `json:"price"`
	Available   bool   `json:"available"`
	ComboItemID int    `json:"combo_item_id,omitempty"`
}

type Location

type Location struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	PickupStatus string `json:"pickup_status"`
}
type Menu struct {
	Status     string        `json:"status"`
	LocationID int           `json:"location_id"`
	Sections   []MenuSection `json:"sections"`
}
func (m Menu) Flatten() FlatMenu
type MenuItem struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	Price     int    `json:"price"`
	Available bool   `json:"available"`
}
type MenuOptions struct {
	LocationID    int
	Fulfillment   Fulfillment
	PaymentMethod int
	TenderID      int
	Date          string
	Time          string
}
type MenuSection struct {
	ID        int        `json:"id"`
	Name      string     `json:"name"`
	Available bool       `json:"available"`
	Items     []MenuItem `json:"items"`
}

type Order

type Order struct {
	ID         int             `json:"id"`
	LocationID int             `json:"location_id"`
	Barcode    string          `json:"barcode"`
	Total      int             `json:"total"`
	Placed     string          `json:"placed"`
	Complete   bool            `json:"complete"`
	Refunded   bool            `json:"refunded"`
	Items      json.RawMessage `json:"items"`
}

type OrderProgress

type OrderProgress struct {
	ID      int    `json:"id"`
	Stage   string `json:"stage"`
	Message string `json:"message"`
}

type OutcomeUnknown

type OutcomeUnknown struct{ ID int }

func (*OutcomeUnknown) Error

func (e *OutcomeUnknown) Error() string

func (*OutcomeUnknown) ErrorCode

func (e *OutcomeUnknown) ErrorCode() string

type PaymentMethod

type PaymentMethod struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Quote

type Quote struct {
	Total int             `json:"total"`
	Cart  json.RawMessage `json:"cart"`
	Date  string          `json:"date"`
	Time  string          `json:"time"`
}

Jump to

Keyboard shortcuts

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