Updated on 2026-08-14
This commit is contained in:
parent
caf5b6fae7
commit
f2dfe2f8bc
21 changed files with 326 additions and 6 deletions
|
|
@ -0,0 +1,13 @@
|
|||
package com.tangem.domain.settings
|
||||
|
||||
import arrow.core.Either
|
||||
import com.tangem.domain.settings.repositories.SettingsRepository
|
||||
|
||||
class IsGooglePayAvailableUseCase(
|
||||
private val settingsRepository: SettingsRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke() = Either.catch {
|
||||
settingsRepository.isGooglePayAvailability()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.tangem.domain.settings
|
||||
|
||||
import arrow.core.Either
|
||||
import com.tangem.domain.settings.repositories.SettingsRepository
|
||||
|
||||
class IsGoogleServicesAvailableUseCase(
|
||||
private val settingsRepository: SettingsRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke() = Either.catch {
|
||||
settingsRepository.isGoogleServicesAvailability()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.tangem.domain.settings
|
||||
|
||||
import arrow.core.Either
|
||||
import com.tangem.domain.settings.repositories.SettingsRepository
|
||||
|
||||
class SetGooglePayAvailabilityUseCase(
|
||||
private val settingsRepository: SettingsRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(isAvailable: Boolean) = Either.catch {
|
||||
settingsRepository.setGooglePayAvailability(isAvailable)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.tangem.domain.settings
|
||||
|
||||
import arrow.core.Either
|
||||
import com.tangem.domain.settings.repositories.SettingsRepository
|
||||
|
||||
class SetGoogleServicesAvailabilityUseCase(
|
||||
private val settingsRepository: SettingsRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(isAvailable: Boolean) = Either.catch {
|
||||
settingsRepository.setGoogleServicesAvailability(isAvailable)
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.tangem.domain.settings.repositories
|
|||
|
||||
import com.tangem.domain.settings.usercountry.models.UserCountry
|
||||
|
||||
@Suppress("TooManyFunctions")
|
||||
interface SettingsRepository {
|
||||
|
||||
suspend fun shouldShowSaveUserWalletScreen(): Boolean
|
||||
|
|
@ -39,4 +40,12 @@ interface SettingsRepository {
|
|||
suspend fun getUserCountryCodeSync(): UserCountry?
|
||||
|
||||
suspend fun fetchUserCountryCode()
|
||||
|
||||
suspend fun setGoogleServicesAvailability(value: Boolean)
|
||||
|
||||
suspend fun isGoogleServicesAvailability(): Boolean
|
||||
|
||||
suspend fun setGooglePayAvailability(value: Boolean)
|
||||
|
||||
suspend fun isGooglePayAvailability(): Boolean
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue