-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply changes from 2.0.2 release (#134)
* Portfolio grammar fixes * Use portfolio dialog instead of group dialog * EditAsset: show keyboard on screen open * Place cursor at end on focus * Merge multiple instances of same asset in one portfolio * Fix release app name and icon * fix: AddAssetViewModel onAssetValueChange bug * Replace downloadable fonts with font files * Add AD_ID permission * 2.0.2 * Fixing release workflow * Fix portfolio asset add snackbar
- Loading branch information
Showing
37 changed files
with
505 additions
and
133 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
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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
14 changes: 9 additions & 5 deletions
14
...rtfolio/src/main/java/dev/arkbuilders/rate/feature/portfolio/domain/repo/PortfolioRepo.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,17 +1,21 @@ | ||
package dev.arkbuilders.rate.feature.portfolio.domain.repo | ||
|
||
import dev.arkbuilders.rate.core.domain.model.CurrencyCode | ||
import dev.arkbuilders.rate.feature.portfolio.domain.model.Asset | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface PortfolioRepo { | ||
suspend fun allAssets(): List<dev.arkbuilders.rate.feature.portfolio.domain.model.Asset> | ||
suspend fun allAssets(): List<Asset> | ||
|
||
fun allAssetsFlow(): Flow<List<dev.arkbuilders.rate.feature.portfolio.domain.model.Asset>> | ||
fun allAssetsFlow(): Flow<List<Asset>> | ||
|
||
suspend fun getById(id: Long): dev.arkbuilders.rate.feature.portfolio.domain.model.Asset? | ||
suspend fun getById(id: Long): Asset? | ||
|
||
suspend fun setAsset(asset: dev.arkbuilders.rate.feature.portfolio.domain.model.Asset) | ||
suspend fun getAllByCode(code: CurrencyCode): List<Asset> | ||
|
||
suspend fun setAssetsList(list: List<dev.arkbuilders.rate.feature.portfolio.domain.model.Asset>) | ||
suspend fun setAsset(asset: Asset) | ||
|
||
suspend fun setAssetsList(list: List<Asset>) | ||
|
||
suspend fun removeAsset(id: Long): Boolean | ||
} |
24 changes: 24 additions & 0 deletions
24
...rc/main/java/dev/arkbuilders/rate/feature/portfolio/domain/usecase/AddNewAssetsUseCase.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,24 @@ | ||
package dev.arkbuilders.rate.feature.portfolio.domain.usecase | ||
|
||
import dev.arkbuilders.rate.feature.portfolio.domain.model.Asset | ||
import dev.arkbuilders.rate.feature.portfolio.domain.repo.PortfolioRepo | ||
|
||
class AddNewAssetsUseCase( | ||
private val portfolioRepo: PortfolioRepo, | ||
) { | ||
suspend operator fun invoke(assets: List<Asset>) { | ||
val mergedAssets = | ||
assets.map { asset -> | ||
val roomAsset = | ||
portfolioRepo.getAllByCode(asset.code).find { | ||
it.group == asset.group | ||
} | ||
val mergedAsset = | ||
roomAsset?.let { | ||
roomAsset.copy(value = asset.value + roomAsset.value) | ||
} ?: asset | ||
mergedAsset | ||
} | ||
portfolioRepo.setAssetsList(mergedAssets) | ||
} | ||
} |
Oops, something went wrong.