vnorder / com.venuenext.vnorder.orders.data / OrderRepository

OrderRepository

class OrderRepository

OrderRepository VenueNext

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

Constructors

<init>

OrderRepository VenueNext

OrderRepository(context: Context)

Properties

context

var context: Context

experienceItemDao

val experienceItemDao: ExperienceItemDao

experienceUserItemDao

val experienceUserItemDao: ExperienceUserItemDao

lineItemRepository

val lineItemRepository: LineItemRepository

orderDao

val orderDao: OrderDao

orderService

val orderService: OrderService

tickingService

val tickingService: TicketingAccountRepository

venueNextDB

val venueNextDB: VenueNextDatabase

Functions

calculateOrdersItemQuantity

Takes in an Order object and loops through each of it's line items if it has any. Filters out all Tax items, as they can be added as well and increments a counter and finally returns the final item count.

fun calculateOrdersItemQuantity(order: Order?): Int?

count

fun count(): Int

deleteAllOrders

fun deleteAllOrders(): Deferred<Unit>

deleteOrder

fun deleteOrder(orderUUID: String): Deferred<Unit>

fetchOrderExperiences

suspend fun fetchOrderExperiences(): List<Order>

fetchOrders

Pulls all orders for the user from the OrderService.

fun fetchOrders(): Deferred<MutableList<Order>?>

getAllOrders

fun getAllOrders(): List<Order>

getExperienceOrder

fun getExperienceOrder(orderUUID: String): <ERROR CLASS>

getExperienceOrderTotal

fun getExperienceOrderTotal(cart: Cart): <ERROR CLASS>

getOrder

fun getOrder(orderUUID: String): <ERROR CLASS>

getOrders

fun getOrders(userUUID: String): List<Order>

getOrderTotal

fun getOrderTotal(cart: Cart): <ERROR CLASS>

getOrderTotalFromQrCode

suspend fun getOrderTotalFromQrCode(qrCode: String, orderNumber: String, userAttribute: UserAttribute?, affiliations: List<String> = listOf()): <ERROR CLASS>

insertExperienceOrder

fun insertExperienceOrder(order: Order): Deferred<Deferred<Unit>>

insertOrder

fun insertOrder(order: Order): Deferred<Unit>

insertOrders

fun insertOrders(orders: List<Order>): Deferred<Unit>

placeExperienceOrder

fun placeExperienceOrder(cart: Cart): <ERROR CLASS>

placeOrder

fun placeOrder(cart: Cart): <ERROR CLASS>
suspend fun placeOrder(richCheckOutOrderPost: RichCheckOutOrderPost): <ERROR CLASS>

postExperienceRedemption

fun postExperienceRedemption(experienceUserItem: ExperienceUserItem): Deferred<String?>

updateAndInsertOrderData

First, takes in an Order object and sets the order's itemCount value. Second, inserts the updated order into Room. Finally, calls the LineItemRepository to insert the line items for this order, which internally relates the line items to the order via UUID.

fun updateAndInsertOrderData(order: Order?): Deferred<Unit>

updateOrderPhoneNumberAsync

Updates the phone number on an F&B Order.

suspend fun updateOrderPhoneNumberAsync(orderUUID: String, phoneNumber: String): <ERROR CLASS>