diff --git a/app/src/main/java/com/hyperling/expensetracker/ExpenseEvent.kt b/app/src/main/java/com/hyperling/expensetracker/ExpenseEvent.kt index b342f92..5e474dd 100644 --- a/app/src/main/java/com/hyperling/expensetracker/ExpenseEvent.kt +++ b/app/src/main/java/com/hyperling/expensetracker/ExpenseEvent.kt @@ -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 } \ No newline at end of file diff --git a/app/src/main/java/com/hyperling/expensetracker/ExpenseState.kt b/app/src/main/java/com/hyperling/expensetracker/ExpenseState.kt new file mode 100644 index 0000000..620c14e --- /dev/null +++ b/app/src/main/java/com/hyperling/expensetracker/ExpenseState.kt @@ -0,0 +1,10 @@ +package com.hyperling.expensetracker + +data class ExpenseState( + val expenses: List = emptyList(), + val firstName: String = "", + val lastName: String = "", + val phoneNumber: String = "", + val isAddingExpense: Boolean = false, + val sortType: SortType = SortType.NAME, +) diff --git a/app/src/main/java/com/hyperling/expensetracker/SortType.kt b/app/src/main/java/com/hyperling/expensetracker/SortType.kt new file mode 100644 index 0000000..21e3d7f --- /dev/null +++ b/app/src/main/java/com/hyperling/expensetracker/SortType.kt @@ -0,0 +1,7 @@ +package com.hyperling.expensetracker + +enum class SortType { + NAME, + COST, + RATE, +} \ No newline at end of file