-
Notifications
You must be signed in to change notification settings - Fork 1
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
c60a4ea
commit b92f5ca
Showing
39 changed files
with
739 additions
and
365 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
...m/rodrigolmti/lunch/money/companion/composition/bridge/adapter/RecurringFeatureAdapter.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
...om/rodrigolmti/lunch/money/companion/composition/bridge/adapter/SettingsFeatureAdapter.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
21 changes: 13 additions & 8 deletions
21
.../java/com/rodrigolmti/lunch/money/companion/composition/bridge/mapper/BudgetViewMapper.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 |
---|---|---|
@@ -1,19 +1,24 @@ | ||
package com.rodrigolmti.lunch.money.companion.composition.bridge.mapper | ||
|
||
import com.rodrigolmti.lunch.money.companion.composition.domain.model.BudgetModel | ||
import com.rodrigolmti.lunch.money.companion.composition.domain.model.CategoryModel | ||
import com.rodrigolmti.lunch.money.companion.features.budget.BudgetItemView | ||
import com.rodrigolmti.lunch.money.companion.features.budget.BudgetView | ||
|
||
internal fun BudgetModel.toView(currency: String): BudgetView { | ||
return BudgetView( | ||
category = categoryName, | ||
items = data.map { | ||
BudgetItemView( | ||
totalTransactions = it.numTransactions, | ||
totalSpending = it.spendingToBase, | ||
totalBudget = it.budgetAmount, | ||
currency = it.budgetCurrency ?: currency, | ||
) | ||
} | ||
items = data.mapValues { | ||
it.value.toView(currency) | ||
}, | ||
) | ||
} | ||
|
||
internal fun CategoryModel.toView(currency: String): BudgetItemView { | ||
return BudgetItemView( | ||
totalTransactions = numTransactions, | ||
totalSpending = spendingToBase, | ||
totalBudget = budgetToBase, | ||
currency = currency, | ||
) | ||
} |
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.