Inventoryz

interface Inventoryz : CleanUpz

Blueprint for managing a store's (your applications) entire collection of available products (inventory)

Functions

Link copied to clipboard
abstract fun destroy()

Apply to UI(main thread) dependent classes that require clean-up logic.

Link copied to clipboard
abstract fun getProduct(sku: String?): Productz?

Search for a specified product by sku id.

Link copied to clipboard
abstract fun getProducts(type: Productz.Type?, promo: Productz.Promotion?): Map<String, Productz>

Get all available products (in cache), set productType to null to query all products. Available products are validated. Note: the list will be empty if the inventory has not been properly updated.

Link copied to clipboard
abstract fun isReadyLiveData(): LiveData<Boolean>
Link copied to clipboard
abstract fun isReadyStateFlow(): StateFlow<Boolean>

Validates if the inventory has collection of verified skus cached in-memory.

Link copied to clipboard
abstract fun queryInventory(products: Map<String, Productz.Type>): QueryResult<Map<String, Productz>>
Link copied to clipboard
abstract fun queryProduct(sku: String, type: Productz.Type): QueryResult<Productz>

kotlin coroutine function for querying a specific product

Link copied to clipboard
abstract fun updateInventory(products: List<Productz>?, type: Productz.Type)

Properties

Link copied to clipboard
abstract var allProducts: Map<String, Productz.Type>

Current cache of all products that is provided by your app/server. This list may include both verified and unverified skus.

Link copied to clipboard
abstract var consumables: ArrayMap<String, Productz>

Current cache of available consumables.

Link copied to clipboard
abstract var isNewVersion: Boolean

For providing version compatability changes

Link copied to clipboard
abstract var nonConsumables: ArrayMap<String, Productz>

Current cache of available non-consumables.

Link copied to clipboard
abstract var subscriptions: ArrayMap<String, Productz>

Current cache of available subscriptions.