Revenues Screen View Model

The RevenuesScreenViewModel class is the support class used by the com.tecknobit.neutron.ui.screens.revenues.presenter.RevenuesScreen

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val hideBalances: StateFlow<Boolean>
Link copied to clipboard

labelsFilter the list of the labels to use as filters

Link copied to clipboard
val revenuePeriod: StateFlow<RevenuePeriod>
Link copied to clipboard
val revenuesState: PaginationState<Int, Revenue>

revenuesState the state used to manage the pagination of the revenues

Link copied to clipboard
Link copied to clipboard
lateinit var state: SessionFlowState

sessionFlowState the state used to manage the session lifecycle in the screen

Link copied to clipboard
val walletStatus: StateFlow<WalletStatus?>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun applyLabelsFilters(onApply: () -> Unit)

Method to apply the labels filters

Link copied to clipboard

Method to apply the retrieveGeneralRevenues filter

Link copied to clipboard

Method to apply the retrieveProjectsRevenues filter

Link copied to clipboard
fun applyRevenuePeriodFilter(revenuePeriod: RevenuePeriod, afterSet: () -> Unit)

Method to apply the period filter to the revenues retrieving

Link copied to clipboard
open override fun canRetrieverStart(): Boolean
Link copied to clipboard
open override fun continueToRetrieve(currentContext: KClass<*>): Boolean
Link copied to clipboard
fun deleteRevenue(revenue: Revenue, onDelete: () -> Unit)

Method to delete a revenue

Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard

Method to request the current status of the wallet

Link copied to clipboard

Method to manage the _hideBalances state

Link copied to clipboard
open override fun notifyConnectionError()

Method to notify a connection error

Link copied to clipboard
open override fun refreshData()

Method to refresh the data after a filter applying or a revenue deletion

Link copied to clipboard
open override fun restartRetriever()
Link copied to clipboard
open fun restartRetrieverIf(condition: Boolean)
Link copied to clipboard
open override fun retrieve(currentContext: KClass<*>, routine: suspend () -> Unit, repeatRoutine: Boolean, refreshDelay: Long)
Link copied to clipboard

Method to retrieve the current labels of the user

Link copied to clipboard
open override fun retryAfterConnectionError()

Method to retrieve the information on the revenues and the wallet status after a connection error

Link copied to clipboard
open fun setActiveContext(currentContext: KClass<*>)
Link copied to clipboard
fun showSnackbarMessage(message: String, actionLabel: String?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
fun showSnackbarMessage(response: JsonObject, actionLabel: String?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
fun showSnackbarMessage(message: StringResource, actionLabel: StringResource?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
Link copied to clipboard
open override fun suspendRetriever()
Link copied to clipboard
open fun suspendRetrieverIf(condition: Boolean)