diff --git a/screen/transactions/src/main/java/com/ivy/transactions/TransactionsViewModel.kt b/screen/transactions/src/main/java/com/ivy/transactions/TransactionsViewModel.kt index f373c285f8..397cd32a4c 100644 --- a/screen/transactions/src/main/java/com/ivy/transactions/TransactionsViewModel.kt +++ b/screen/transactions/src/main/java/com/ivy/transactions/TransactionsViewModel.kt @@ -15,7 +15,6 @@ import com.ivy.base.model.TransactionType import com.ivy.base.time.TimeConverter import com.ivy.base.time.TimeProvider import com.ivy.data.db.dao.read.AccountDao -import com.ivy.data.db.dao.write.WriteCategoryDao import com.ivy.data.db.dao.write.WritePlannedPaymentRuleDao import com.ivy.data.model.AccountId import com.ivy.data.model.Category @@ -91,7 +90,6 @@ class TransactionsViewModel @Inject constructor( private val calcTrnsIncomeExpenseAct: LegacyCalcTrnsIncomeExpenseAct, private val exchangeAct: ExchangeAct, private val transactionRepository: TransactionRepository, - private val categoryWriter: WriteCategoryDao, private val plannedPaymentRuleWriter: WritePlannedPaymentRuleDao, private val transactionMapper: TransactionMapper, private val tagRepository: TagRepository, @@ -740,7 +738,6 @@ class TransactionsViewModel @Inject constructor( private suspend fun deleteCategory(categoryId: UUID) { ioThread { - categoryWriter.deleteById(categoryId) categoryRepository.deleteById(CategoryId(categoryId)) nav.back() diff --git a/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/category/CategoriesAct.kt b/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/category/CategoriesAct.kt deleted file mode 100644 index eb2e0dd852..0000000000 --- a/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/category/CategoriesAct.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.ivy.wallet.domain.action.category - -import com.ivy.data.db.dao.read.CategoryDao -import com.ivy.frp.action.FPAction -import com.ivy.frp.action.thenMap -import com.ivy.frp.then -import com.ivy.legacy.datamodel.Category -import com.ivy.legacy.datamodel.temp.toLegacyDomain -import kotlinx.collections.immutable.ImmutableList -import kotlinx.collections.immutable.toImmutableList -import javax.inject.Inject - -class CategoriesAct @Inject constructor( - private val categoryDao: CategoryDao -) : FPAction>() { - override suspend fun Unit.compose(): suspend () -> ImmutableList = suspend { - io { - categoryDao.findAll() - } - } thenMap { it.toLegacyDomain() } then { it.toImmutableList() } -} diff --git a/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/category/CategoryByIdAct.kt b/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/category/CategoryByIdAct.kt deleted file mode 100644 index 32f1067b1f..0000000000 --- a/temp/legacy-code/src/main/java/com/ivy/legacy/domain/action/category/CategoryByIdAct.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.ivy.wallet.domain.action.category - -import com.ivy.data.db.dao.read.CategoryDao -import com.ivy.frp.action.FPAction -import com.ivy.legacy.datamodel.Category -import com.ivy.legacy.datamodel.temp.toLegacyDomain -import java.util.UUID -import javax.inject.Inject - -class CategoryByIdAct @Inject constructor( - private val categoryDao: CategoryDao -) : FPAction() { - override suspend fun UUID.compose(): suspend () -> Category? = suspend { - categoryDao.findById(this)?.toLegacyDomain() - } -}