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

Commit

Permalink
Rename fp to pure
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Apr 24, 2022
1 parent b103bda commit 13dd3f8
Show file tree
Hide file tree
Showing 47 changed files with 140 additions and 145 deletions.
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 @@ -6,7 +6,6 @@ import com.google.gson.GsonBuilder
import com.ivy.design.navigation.Navigation
import com.ivy.wallet.android.billing.IvyBilling
import com.ivy.wallet.android.notification.NotificationService
import com.ivy.wallet.domain.fp.data.WalletDAOs
import com.ivy.wallet.domain.logic.*
import com.ivy.wallet.domain.logic.bankintegrations.BankIntegrationsLogic
import com.ivy.wallet.domain.logic.bankintegrations.SaltEdgeAccountMapper
Expand All @@ -20,6 +19,7 @@ import com.ivy.wallet.domain.logic.loantrasactions.LoanTransactionsCore
import com.ivy.wallet.domain.logic.loantrasactions.LoanTransactionsLogic
import com.ivy.wallet.domain.logic.notification.TransactionReminderLogic
import com.ivy.wallet.domain.logic.zip.ExportZipLogic
import com.ivy.wallet.domain.pure.data.WalletDAOs
import com.ivy.wallet.domain.sync.IvySync
import com.ivy.wallet.domain.sync.item.*
import com.ivy.wallet.domain.sync.uploader.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.ivy.wallet.domain.action

import arrow.core.Option
import com.ivy.wallet.domain.action.framework.FPAction
import com.ivy.wallet.domain.fp.exchange
import com.ivy.wallet.domain.pure.exchange
import com.ivy.wallet.io.persistence.dao.ExchangeRateDao
import java.math.BigDecimal
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.ivy.wallet.domain.action.account

import com.ivy.wallet.domain.action.framework.FPAction
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.io.persistence.dao.TransactionDao
import java.util.*
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import arrow.core.nonEmptyListOf
import com.ivy.wallet.domain.action.framework.FPAction
import com.ivy.wallet.domain.action.framework.then
import com.ivy.wallet.domain.data.entity.Account
import com.ivy.wallet.domain.fp.account.AccountValueFunctions
import com.ivy.wallet.domain.fp.account.calcAccValues
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.account.AccountValueFunctions
import com.ivy.wallet.domain.pure.account.calcAccValues
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import java.math.BigDecimal
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package com.ivy.wallet.domain.action.charts

import com.ivy.wallet.domain.action.framework.FPAction
import com.ivy.wallet.domain.action.wallet.CalcWalletBalanceAct
import com.ivy.wallet.domain.fp.charts.ChartPeriod
import com.ivy.wallet.domain.fp.charts.SingleChartPoint
import com.ivy.wallet.domain.fp.charts.balanceChart
import com.ivy.wallet.domain.pure.charts.ChartPeriod
import com.ivy.wallet.domain.pure.charts.SingleChartPoint
import com.ivy.wallet.domain.pure.charts.balanceChart
import javax.inject.Inject

class BalanceChartAct @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.ivy.wallet.domain.action.transaction

import com.ivy.wallet.domain.action.framework.Action
import com.ivy.wallet.domain.data.TransactionHistoryItem
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.fp.data.WalletDAOs
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.WalletDAOs
import javax.inject.Inject

class HistoryWithDateDivAct @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.ivy.wallet.domain.action.wallet

import com.ivy.wallet.domain.action.framework.Action
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.data.IncomeExpensePair
import com.ivy.wallet.domain.logic.WalletLogic
import com.ivy.wallet.domain.pure.data.IncomeExpensePair
import com.ivy.wallet.ui.onboarding.model.FromToTimeRange
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.ivy.wallet.domain.action.wallet

import com.ivy.wallet.domain.action.framework.Action
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.data.IncomeExpensePair
import com.ivy.wallet.domain.logic.WalletLogic
import com.ivy.wallet.domain.pure.data.IncomeExpensePair
import com.ivy.wallet.ui.onboarding.model.FromToTimeRange
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.ivy.wallet.domain.action.ExchangeAct
import com.ivy.wallet.domain.action.account.AccountsAct
import com.ivy.wallet.domain.action.account.CalcAccBalanceAct
import com.ivy.wallet.domain.action.framework.*
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import java.math.BigDecimal
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.ivy.wallet.domain.fp
package com.ivy.wallet.domain.pure

import arrow.core.None
import arrow.core.Option
import arrow.core.Some
import arrow.core.computations.option
import arrow.core.toOption
import com.ivy.wallet.domain.data.entity.ExchangeRate
import com.ivy.wallet.domain.fp.core.Pure
import com.ivy.wallet.domain.fp.core.SideEffect
import com.ivy.wallet.domain.pure.core.Pure
import com.ivy.wallet.domain.pure.core.SideEffect
import com.ivy.wallet.utils.isNotNullOrBlank
import java.math.BigDecimal

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.ivy.wallet.domain.fp.account
package com.ivy.wallet.domain.pure.account

import arrow.core.NonEmptyList
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.core.Pure
import com.ivy.wallet.domain.fp.core.Total
import com.ivy.wallet.domain.fp.core.calculateValueFunctionsSum
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.fp.data.toFPTransaction
import com.ivy.wallet.domain.pure.core.Pure
import com.ivy.wallet.domain.pure.core.Total
import com.ivy.wallet.domain.pure.core.calculateValueFunctionsSum
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.toFPTransaction
import com.ivy.wallet.io.persistence.dao.TransactionDao
import java.math.BigDecimal
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.fp.account
package com.ivy.wallet.domain.pure.account

import arrow.core.nonEmptyListOf
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.fp.data.IncomeExpensePair
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.IncomeExpensePair
import com.ivy.wallet.io.persistence.dao.TransactionDao
import java.math.BigDecimal
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.fp.account
package com.ivy.wallet.domain.pure.account

import com.ivy.wallet.domain.data.TransactionType
import com.ivy.wallet.domain.fp.core.ValueFunction
import com.ivy.wallet.domain.fp.data.FPTransaction
import com.ivy.wallet.domain.pure.core.ValueFunction
import com.ivy.wallet.domain.pure.data.FPTransaction
import java.math.BigDecimal
import java.util.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.ivy.wallet.domain.fp.category
package com.ivy.wallet.domain.pure.category

import arrow.core.NonEmptyList
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.core.calculateValueFunctionsSumSuspend
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.fp.data.WalletDAOs
import com.ivy.wallet.domain.fp.data.toFPTransaction
import com.ivy.wallet.domain.pure.core.calculateValueFunctionsSumSuspend
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.WalletDAOs
import com.ivy.wallet.domain.pure.data.toFPTransaction
import java.math.BigDecimal
import java.util.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ivy.wallet.domain.fp.category
package com.ivy.wallet.domain.pure.category

import arrow.core.nonEmptyListOf
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.fp.data.WalletDAOs
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.WalletDAOs
import java.math.BigDecimal
import java.util.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.ivy.wallet.domain.fp.category
package com.ivy.wallet.domain.pure.category

import arrow.core.Option
import arrow.core.toOption
import com.ivy.wallet.domain.data.TransactionType
import com.ivy.wallet.domain.data.entity.Account
import com.ivy.wallet.domain.fp.core.SuspendValueFunction
import com.ivy.wallet.domain.fp.data.FPTransaction
import com.ivy.wallet.domain.fp.exchangeToBaseCurrency
import com.ivy.wallet.domain.pure.core.SuspendValueFunction
import com.ivy.wallet.domain.pure.data.FPTransaction
import com.ivy.wallet.domain.pure.exchangeToBaseCurrency
import com.ivy.wallet.io.persistence.dao.ExchangeRateDao
import java.math.BigDecimal
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.ivy.wallet.domain.fp.charts
package com.ivy.wallet.domain.pure.charts

import com.ivy.wallet.R
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.stringRes
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.utils.dateNowUTC
import com.ivy.wallet.utils.endOfDayNowUTC
import com.ivy.wallet.utils.endOfMonth
Expand All @@ -17,10 +15,10 @@ enum class ChartPeriod {

fun display(): String {
return when (this) {
LAST_12_MONTHS -> stringRes(R.string.last_12_months)
LAST_6_MONTHS -> stringRes(R.string.last_6_months)
LAST_4_WEEKS -> stringRes(R.string.last_4_weeks)
LAST_7_DAYS -> stringRes(R.string.last_7_days)
LAST_12_MONTHS -> "Last 12 months"
LAST_6_MONTHS -> "Last 6 months"
LAST_4_WEEKS -> "Last 4 weeks"
LAST_7_DAYS -> "Last 7 days"
}
}

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

import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.fp.data.IncomeExpensePair
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.IncomeExpensePair
import java.math.BigDecimal

data class ChartPoint<V>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.ivy.wallet.domain.fp.charts

import com.ivy.wallet.domain.fp.core.Pure
import com.ivy.wallet.domain.fp.core.SideEffect
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
import com.ivy.wallet.domain.fp.data.IncomeExpensePair
import com.ivy.wallet.domain.fp.data.WalletDAOs
import com.ivy.wallet.domain.fp.wallet.calculateWalletIncomeExpense
import com.ivy.wallet.domain.fp.wallet.calculateWalletIncomeExpenseCount
package com.ivy.wallet.domain.pure.charts

import com.ivy.wallet.domain.pure.core.Pure
import com.ivy.wallet.domain.pure.core.SideEffect
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.IncomeExpensePair
import com.ivy.wallet.domain.pure.data.WalletDAOs
import com.ivy.wallet.domain.pure.wallet.calculateWalletIncomeExpense
import com.ivy.wallet.utils.beginningOfIvyTime
import com.ivy.wallet.utils.toEpochSeconds
import java.math.BigDecimal
Expand Down Expand Up @@ -122,12 +121,13 @@ suspend fun incomeExpenseCountChart(
return generateIncomeExpenseCountChart(
orderedPeriod = orderedPeriod,
calculateWalletIncomeExpenseCount = { range ->
calculateWalletIncomeExpenseCount(
walletDAOs = walletDAOs,
baseCurrencyCode = baseCurrencyCode,
range = range,
filterExcluded = true
).value
TODO()
// calculateWalletIncomeExpenseCount(
// walletDAOs = walletDAOs,
// baseCurrencyCode = baseCurrencyCode,
// range = range,
// filterExcluded = true
// ).value
}
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ivy.wallet.domain.fp.core
package com.ivy.wallet.domain.pure.core

@Target(AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.SOURCE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.ivy.wallet.domain.fp.core
package com.ivy.wallet.domain.pure.core

import com.ivy.wallet.domain.data.TransactionType
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.data.FPTransaction
import com.ivy.wallet.domain.fp.data.toFPTransaction
import com.ivy.wallet.domain.pure.data.FPTransaction
import com.ivy.wallet.domain.pure.data.toFPTransaction
import java.math.BigDecimal

suspend fun <A> sum(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ivy.wallet.domain.fp.core
package com.ivy.wallet.domain.pure.core

data class Uncertain<E : List<*>, V>(
val error: E,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ivy.wallet.domain.fp.core
package com.ivy.wallet.domain.pure.core

import arrow.core.NonEmptyList
import java.math.BigDecimal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ivy.wallet.domain.fp.core
package com.ivy.wallet.domain.pure.core

import arrow.core.NonEmptyList
import com.ivy.wallet.domain.fp.data.FPTransaction
import com.ivy.wallet.domain.pure.data.FPTransaction
import java.math.BigDecimal

typealias ValueFunction<A> = (FPTransaction, A) -> BigDecimal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ivy.wallet.domain.fp.data
package com.ivy.wallet.domain.pure.data

import com.ivy.wallet.ui.onboarding.model.FromToTimeRange
import com.ivy.wallet.utils.beginningOfIvyTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.ivy.wallet.domain.fp.data
package com.ivy.wallet.domain.pure.data

data class CurrencyConvError(val account: FPAccount)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ivy.wallet.domain.fp.data
package com.ivy.wallet.domain.pure.data

import arrow.core.Option
import arrow.core.toOption
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ivy.wallet.domain.fp.data
package com.ivy.wallet.domain.pure.data

import arrow.core.Option
import arrow.core.toOption
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ivy.wallet.domain.fp.data
package com.ivy.wallet.domain.pure.data

import java.math.BigDecimal

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ivy.wallet.domain.fp.data
package com.ivy.wallet.domain.pure.data

import com.ivy.wallet.io.persistence.dao.AccountDao
import com.ivy.wallet.io.persistence.dao.ExchangeRateDao
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package com.ivy.wallet.domain.fp.wallet
package com.ivy.wallet.domain.pure.wallet

import arrow.core.NonEmptyList
import arrow.core.Some
import arrow.core.toOption
import com.ivy.wallet.domain.data.entity.Account
import com.ivy.wallet.domain.data.entity.ExchangeRate
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.ExchangeData
import com.ivy.wallet.domain.fp.account.AccountValueFunction
import com.ivy.wallet.domain.fp.account.calcAccValues
import com.ivy.wallet.domain.fp.core.SideEffect
import com.ivy.wallet.domain.fp.core.Uncertain
import com.ivy.wallet.domain.fp.core.mapIndexedNel
import com.ivy.wallet.domain.fp.core.nonEmptyListOfZeros
import com.ivy.wallet.domain.fp.data.*
import com.ivy.wallet.domain.fp.exchange
import com.ivy.wallet.domain.pure.ExchangeData
import com.ivy.wallet.domain.pure.account.AccountValueFunction
import com.ivy.wallet.domain.pure.account.calcAccValues
import com.ivy.wallet.domain.pure.core.SideEffect
import com.ivy.wallet.domain.pure.core.Uncertain
import com.ivy.wallet.domain.pure.core.mapIndexedNel
import com.ivy.wallet.domain.pure.core.nonEmptyListOfZeros
import com.ivy.wallet.domain.pure.data.*
import com.ivy.wallet.domain.pure.exchange
import com.ivy.wallet.utils.scopedIOThread
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
Expand Down
Loading

0 comments on commit 13dd3f8

Please sign in to comment.