Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Migrate ivy-fp to com.github.ILIYANGERMANOV:ivy-frp library
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed May 19, 2022
1 parent f613aba commit feb2760
Show file tree
Hide file tree
Showing 147 changed files with 219 additions and 1,005 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import androidx.test.platform.app.InstrumentationRegistry
import androidx.work.Configuration
import androidx.work.impl.utils.SynchronousExecutor
import androidx.work.testing.WorkManagerTestInitHelper
import com.ivy.design.navigation.Navigation
import com.ivy.fp.test.TestIdlingResource
import com.ivy.fp.test.TestingContext
import com.ivy.frp.test.TestIdlingResource
import com.ivy.frp.test.TestingContext
import com.ivy.frp.view.navigation.Navigation
import com.ivy.wallet.io.network.IvySession
import com.ivy.wallet.io.persistence.IvyRoomDatabase
import com.ivy.wallet.io.persistence.SharedPrefs
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/ivy/wallet/AppModuleDI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.ivy.wallet
import android.content.Context
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.ivy.design.navigation.Navigation
import com.ivy.frp.view.navigation.Navigation
import com.ivy.wallet.android.billing.IvyBilling
import com.ivy.wallet.android.notification.NotificationService
import com.ivy.wallet.domain.deprecated.logic.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.account

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.account

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.data.core.Account
import com.ivy.wallet.io.persistence.dao.AccountDao
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.account

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import com.ivy.wallet.domain.data.core.Account
import com.ivy.wallet.io.persistence.dao.AccountDao
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.action.account

import arrow.core.nonEmptyListOf
import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.data.core.Account
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.transaction.AccountValueFunctions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.action.account

import arrow.core.nonEmptyListOf
import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.data.core.Account
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.IncomeExpensePair
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.budget

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.action.thenMap
import com.ivy.wallet.domain.data.core.Budget
import com.ivy.wallet.io.persistence.dao.BudgetDao
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.category

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.action.thenMap
import com.ivy.wallet.domain.data.core.Category
import com.ivy.wallet.io.persistence.dao.CategoryDao
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.category

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import com.ivy.wallet.domain.data.core.Category
import com.ivy.wallet.io.persistence.dao.CategoryDao
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.category

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.action.transaction.CalcTrnsIncomeExpenseAct
import com.ivy.wallet.domain.data.core.Account
import com.ivy.wallet.domain.data.core.Category
Expand All @@ -13,7 +13,7 @@ class CategoryIncomeWithAccountFiltersAct @Inject constructor(
private val calcTrnsIncomeExpenseAct: CalcTrnsIncomeExpenseAct
) : FPAction<CategoryIncomeWithAccountFiltersAct.Input, IncomeExpenseTransferPair>() {

override suspend fun Input.compose(): suspend () -> IncomeExpenseTransferPair = {
override suspend fun Input.compose(): suspend () -> IncomeExpenseTransferPair = suspend {
val accountFilterSet = accountFilterList.map { it.id }.toHashSet()
transactions.filter {
it.categoryId == category?.id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.category

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.charts

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import com.ivy.wallet.domain.action.wallet.CalcWalletBalanceAct
import com.ivy.wallet.domain.pure.charts.ChartPeriod
import com.ivy.wallet.domain.pure.charts.SingleChartPoint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.ivy.wallet.domain.action.charts

import androidx.compose.ui.graphics.toArgb
import com.ivy.fp.Pure
import com.ivy.fp.SideEffect
import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.fp.action.thenFilter
import com.ivy.fp.action.thenMap
import com.ivy.frp.Pure
import com.ivy.frp.SideEffect
import com.ivy.frp.action.FPAction
import com.ivy.frp.action.thenFilter
import com.ivy.frp.action.thenMap
import com.ivy.frp.then
import com.ivy.wallet.R
import com.ivy.wallet.domain.action.account.AccountsAct
import com.ivy.wallet.domain.action.category.CategoriesAct
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.action.exchange

import arrow.core.Option
import com.ivy.fp.action.FPAction
import com.ivy.fp.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.pure.exchange.ExchangeData
import com.ivy.wallet.domain.pure.exchange.exchange
import com.ivy.wallet.io.persistence.dao.ExchangeRateDao
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.global

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.io.persistence.SharedPrefs
import com.ivy.wallet.ui.IvyWalletCtx
import javax.inject.Inject
Expand All @@ -11,7 +11,7 @@ class StartDayOfMonthAct @Inject constructor(
private val ivyWalletCtx: IvyWalletCtx
) : FPAction<Unit, Int>() {

override suspend fun Unit.compose(): suspend () -> Int = {
override suspend fun Unit.compose(): suspend () -> Int = suspend {
sharedPrefs.getInt(SharedPrefs.START_DATE_OF_MONTH, 1)
} then { startDay ->
ivyWalletCtx.setStartDayOfMonth(startDay)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.action.global

import com.ivy.fp.action.FPAction
import com.ivy.fp.monad.Res
import com.ivy.fp.monad.thenR
import com.ivy.frp.action.FPAction
import com.ivy.frp.monad.Res
import com.ivy.frp.monad.thenR
import com.ivy.wallet.io.persistence.SharedPrefs
import com.ivy.wallet.ui.IvyWalletCtx
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.loan

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import com.ivy.wallet.domain.data.core.Loan
import com.ivy.wallet.io.persistence.dao.LoanDao
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.loan

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.action.thenMap
import com.ivy.wallet.domain.data.core.Loan
import com.ivy.wallet.io.persistence.dao.LoanDao
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.settings

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import com.ivy.wallet.io.persistence.dao.SettingsDao
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.settings

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import java.math.BigDecimal
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.settings

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.data.core.Settings
import com.ivy.wallet.io.persistence.dao.SettingsDao
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.settings

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import com.ivy.wallet.domain.data.core.Settings
import com.ivy.wallet.io.persistence.dao.SettingsDao
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.transaction

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.action.thenMap
import com.ivy.wallet.domain.data.core.Transaction
import com.ivy.wallet.io.persistence.dao.TransactionDao
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.ivy.wallet.domain.action.transaction

import arrow.core.nonEmptyListOf
import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.fp.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.action.exchange.ExchangeAct
import com.ivy.wallet.domain.action.exchange.actInput
import com.ivy.wallet.domain.data.core.Account
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.transaction

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.transaction

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.transaction

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.data.TransactionHistoryItem
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.transaction

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.data.core.Transaction
import com.ivy.wallet.io.persistence.dao.TransactionDao
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.transaction

import com.ivy.fp.action.FPAction
import com.ivy.fp.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.action.exchange.ExchangeAct
import com.ivy.wallet.domain.action.exchange.actInput
import com.ivy.wallet.domain.data.TransactionHistoryItem
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.transaction

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenFilter
import com.ivy.frp.action.FPAction
import com.ivy.frp.action.thenFilter
import com.ivy.wallet.domain.data.core.Transaction
import com.ivy.wallet.io.persistence.dao.TransactionDao
import com.ivy.wallet.ui.onboarding.model.FromToTimeRange
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.action.viewmodel.account

import arrow.core.toOption
import com.ivy.fp.action.FPAction
import com.ivy.fp.action.thenMap
import com.ivy.frp.action.FPAction
import com.ivy.frp.action.thenMap
import com.ivy.wallet.domain.action.account.CalcAccBalanceAct
import com.ivy.wallet.domain.action.account.CalcAccIncomeExpenseAct
import com.ivy.wallet.domain.action.exchange.ExchangeAct
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.action.viewmodel.experiment

import com.ivy.fp.action.FPAction
import com.ivy.fp.monad.Res
import com.ivy.fp.monad.tryOp
import com.ivy.frp.action.FPAction
import com.ivy.frp.monad.Res
import com.ivy.frp.monad.tryOp
import com.ivy.wallet.io.network.service.ExpImagesService
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.ivy.wallet.domain.action.viewmodel.home

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.lambda
import com.ivy.fp.action.then
import com.ivy.fp.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.lambda
import com.ivy.frp.then

import com.ivy.wallet.domain.action.account.AccountByIdAct
import com.ivy.wallet.domain.action.exchange.ExchangeAct
import com.ivy.wallet.domain.action.exchange.actInput
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.viewmodel.home

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import com.ivy.wallet.io.persistence.dao.TransactionDao
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.action.viewmodel.home

import com.ivy.fp.action.FPAction
import com.ivy.fp.action.then
import com.ivy.frp.action.FPAction
import com.ivy.frp.then
import com.ivy.wallet.domain.data.core.Transaction
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.IncomeExpensePair
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ivy.wallet.domain.action.viewmodel.home

import com.ivy.fp.action.FPAction
import com.ivy.frp.action.FPAction
import com.ivy.wallet.io.persistence.SharedPrefs
import javax.inject.Inject

Expand Down
Loading

0 comments on commit feb2760

Please sign in to comment.