This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34605f9
commit d9402d5
Showing
8 changed files
with
150 additions
and
97 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
app/src/main/java/com/ivy/wallet/domain/action/category/CategoryByIdAct.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.ivy.wallet.domain.action.category | ||
|
||
import com.ivy.fp.action.FPAction | ||
import com.ivy.wallet.domain.data.core.Category | ||
import com.ivy.wallet.io.persistence.dao.CategoryDao | ||
import java.util.* | ||
import javax.inject.Inject | ||
|
||
class CategoryByIdAct @Inject constructor( | ||
private val categoryDao: CategoryDao | ||
) : FPAction<UUID, Category?>() { | ||
override suspend fun UUID.compose(): suspend () -> Category? = suspend { | ||
categoryDao.findById(this)?.toDomain() | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/ivy/wallet/domain/action/transaction/TrnByIdAct.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.ivy.wallet.domain.action.transaction | ||
|
||
import com.ivy.fp.action.FPAction | ||
import com.ivy.fp.action.then | ||
import com.ivy.wallet.domain.data.core.Transaction | ||
import com.ivy.wallet.io.persistence.dao.TransactionDao | ||
import java.util.* | ||
import javax.inject.Inject | ||
|
||
class TrnByIdAct @Inject constructor( | ||
private val transactionDao: TransactionDao | ||
) : FPAction<UUID, Transaction?>() { | ||
override suspend fun UUID.compose(): suspend () -> Transaction? = suspend { | ||
this //transactionId | ||
} then transactionDao::findById then { | ||
it?.toDomain() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.