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 712
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
1782f7a
commit d805d14
Showing
40 changed files
with
280 additions
and
76 deletions.
There are no files selected for viewing
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
4 changes: 2 additions & 2 deletions
4
app/src/main/java/com/ivy/wallet/domain/action/account/CalcAccBalanceAct.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
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/ivy/wallet/domain/action/charts/BalanceChartAct.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
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/ivy/wallet/domain/action/settings/BaseCurrencyAct.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
36 changes: 36 additions & 0 deletions
36
app/src/main/java/com/ivy/wallet/domain/action/transaction/AddDateDividersAct.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,36 @@ | ||
package com.ivy.wallet.domain.action.transaction | ||
|
||
import com.ivy.fp.action.FPAction | ||
import com.ivy.fp.then | ||
import com.ivy.wallet.domain.action.ExchangeAct | ||
import com.ivy.wallet.domain.data.TransactionHistoryItem | ||
import com.ivy.wallet.domain.data.core.Transaction | ||
import com.ivy.wallet.domain.pure.wallet.withDateDividers | ||
import com.ivy.wallet.io.persistence.dao.AccountDao | ||
import javax.inject.Inject | ||
|
||
class AddDateDividersAct @Inject constructor( | ||
private val accountDao: AccountDao, | ||
private val exchangeAct: ExchangeAct | ||
) : FPAction<AddDateDividersAct.Input, List<TransactionHistoryItem>>() { | ||
|
||
override suspend fun Input.compose(): suspend () -> List<TransactionHistoryItem> = suspend { | ||
transactions.withDateDividers( | ||
baseCurrencyCode = baseCurrency, | ||
getAccount = accountDao::findById then { it?.toDomain() }, | ||
exchange = { data, amount -> | ||
exchangeAct( | ||
ExchangeAct.Input( | ||
data = data, | ||
amount = amount | ||
) | ||
) | ||
} | ||
) | ||
} | ||
|
||
data class Input( | ||
val baseCurrency: String, | ||
val transactions: List<Transaction> | ||
) | ||
} |
26 changes: 26 additions & 0 deletions
26
app/src/main/java/com/ivy/wallet/domain/action/transaction/HistoryTrnsAct.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,26 @@ | ||
package com.ivy.wallet.domain.action.transaction | ||
|
||
import com.ivy.fp.action.FPAction | ||
import com.ivy.fp.action.thenMap | ||
import com.ivy.wallet.domain.data.core.Transaction | ||
import com.ivy.wallet.domain.pure.data.ClosedTimeRange | ||
import com.ivy.wallet.io.persistence.dao.TransactionDao | ||
import javax.inject.Inject | ||
|
||
class HistoryTrnsAct @Inject constructor( | ||
private val transactionDao: TransactionDao | ||
) : FPAction<HistoryTrnsAct.Input, List<Transaction>>() { | ||
|
||
override suspend fun Input.compose(): suspend () -> List<Transaction> = suspend { | ||
io { | ||
transactionDao.findAllBetween( | ||
startDate = range.from, | ||
endDate = range.to | ||
) | ||
} | ||
} thenMap { it.toDomain() } | ||
|
||
data class Input( | ||
val range: ClosedTimeRange | ||
) | ||
} |
25 changes: 0 additions & 25 deletions
25
app/src/main/java/com/ivy/wallet/domain/action/transaction/HistoryWithDateDivAct.kt
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/ivy/wallet/domain/action/wallet/CalcOverdueAct.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
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/ivy/wallet/domain/action/wallet/CalcUpcomingAct.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
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/ivy/wallet/domain/action/wallet/CalcWalletBalanceAct.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package com.ivy.wallet.domain.pure | ||
|
4 changes: 2 additions & 2 deletions
4
app/src/main/java/com/ivy/wallet/domain/pure/account/AccountCore.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
4 changes: 2 additions & 2 deletions
4
app/src/main/java/com/ivy/wallet/domain/pure/charts/WalletCharts.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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Oops, something went wrong.