Project Screen View Model

The ProjectScreenViewModel class is the support class used by the com.tecknobit.neutron.ui.screens.project.presenter.ProjectScreen

Author

N7ghtm4r3 - Tecknobit

Parameters

projectId

The identifier of the project displayed

See also

Retriever
EquinoxViewModel

Constructors

Link copied to clipboard
constructor(projectId: String)

Properties

Link copied to clipboard
val balance: StateFlow<Double>
Link copied to clipboard
val hideBalances: StateFlow<Boolean>
Link copied to clipboard
val project: StateFlow<ProjectRevenue?>
Link copied to clipboard
Link copied to clipboard
val revenuePeriod: StateFlow<RevenuePeriod>
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 ticketsState: PaginationState<Int, TicketRevenue>

ticketsState the state used to manage the pagination of the tickets

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard

Method to apply the retrieveClosedTickets filter

Link copied to clipboard

Method to apply the retrievePendingTickets 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

Method request to close a ticket

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

Method request to delete a ticket

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

Method to request the current balance of a project

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 project specified by the projectId

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)