Add state as well as fix SortType needs.

This commit is contained in:
Hyperling 2025-01-09 14:19:03 -07:00
parent d5d525f65a
commit a4513394d1
3 changed files with 18 additions and 1 deletions

View File

@ -7,6 +7,6 @@ sealed interface ExpenseEvent {
data class SetRate(val rate: Rate): ExpenseEvent
object ShowDialog: ExpenseEvent
object HideDialog: ExpenseEvent
data class SortExpenses(val rate: Rate): ExpenseEvent
data class SortExpenses(val sortType: SortType): ExpenseEvent
data class DeleteExpense(val expense: Expense): ExpenseEvent
}

View File

@ -0,0 +1,10 @@
package com.hyperling.expensetracker
data class ExpenseState(
val expenses: List<Expense> = emptyList(),
val firstName: String = "",
val lastName: String = "",
val phoneNumber: String = "",
val isAddingExpense: Boolean = false,
val sortType: SortType = SortType.NAME,
)

View File

@ -0,0 +1,7 @@
package com.hyperling.expensetracker
enum class SortType {
NAME,
COST,
RATE,
}