social-common / pragma.order / Orders /

Orders #

interface Orders

A smart object for modifying and fetching order information and state. All methods represent synchronous database calls. Created by the pragma.order.OrdersFactory.

Functions #

NameSummary

addOrder

abstract suspend fun addOrder(skuId: String, quantity: Int, providerSource: ProviderSource, providerDetails: ProviderDetails, purchaseDateMillis: Long): Order

Stores an order in the database.

getPendingProviderOrders

abstract suspend fun getPendingProviderOrders(): Collection<Order>

Fetches a list of orders with an order status of OrderRpc.OrderStatus.ORDER_STATUS_PENDING for the registered social id and provider type.

getProviderOrders

abstract suspend fun getProviderOrders(): Collection<Order>

Fetches a list of orders for the registered social id and provider type.

markOrderReceived

abstract suspend fun markOrderReceived(orderId: UUID)

Updates the status of the specified order to OrderRpc.OrderStatus.ORDER_STATUS_RECEIVED.

markOrderRevoked

abstract suspend fun markOrderRevoked(orderId: UUID, providerRevokedDateMillis: Long)

Updates the status of the specified order to OrderRpc.OrderStatus.ORDER_STATUS_REVOKED.

updateProviderDetails

abstract suspend fun updateProviderDetails(orderId: UUID, providerDetails: ProviderDetails)

Overwrites the provider details for the specified order.