vnorderui / com.venuenext.vnorderui.stands / MenuViewModel

MenuViewModel

class MenuViewModel : AndroidViewModel

MenuViewModel VenueNext

Created on 3/8/19. Copyright © 2019 VenueNext Inc. All rights reserved.

Constructors

<init>

MenuViewModel VenueNext

MenuViewModel(application: Application)

Properties

categories

var categories: List<Category>?

currentEvent

var currentEvent: Event?

currentItem

var currentItem: Item?

currentMenu

var currentMenu: Menu?

events

var events: List<Event>?

items

var items: List<Item>?

modifierCategories

var modifierCategories: List<Category>?

toMenuId

UUID will be set when the user navigates to a Menu as the first screen.

var toMenuId: String?

Functions

getClosestVariantForItem

fun getClosestVariantForItem(item: Item?): Variant?

getItems

fun getItems(menuUUID: String): Deferred<List<Item>>

getOrderTotal

fun getOrderTotal(cart: Cart): Deferred<Order?>

populateEventListForSelection

fun populateEventListForSelection(): ArrayList<Any>?

reloadMenuItems

fun reloadMenuItems(menu: Menu): Deferred<Unit>

removeInvalidItems

fun removeInvalidItems(items: List<Item>): List<Item>?

syncCategories

fun syncCategories(menu: Menu, result: GetMenuItemsResult?): Deferred<Unit>

syncEvents

fun syncEvents(menu: Menu, result: GetMenuItemsResult?): Deferred<Unit>

syncItems

fun syncItems(menu: Menu, result: GetMenuItemsResult?): Deferred<Unit>

syncModifierCategories

fun syncModifierCategories(menu: Menu, result: GetMenuItemsResult?): Deferred<Unit>

updateMenu

fun updateMenu(menu: Menu, result: GetMenuItemsResult?): Deferred<Unit>