Updated on 2026-08-14
This commit is contained in:
parent
64fda96648
commit
72725adfa9
7 changed files with 27 additions and 4 deletions
|
|
@ -7,4 +7,6 @@ interface WalletsPromoRepository {
|
|||
suspend fun bindRefcodeWithWallets(conversionData: AppsFlyerConversionData)
|
||||
|
||||
suspend fun retryBindRefcodeWithWallets()
|
||||
|
||||
suspend fun getReferralCodeIfExists(): String?
|
||||
}
|
||||
|
|
@ -1,18 +1,23 @@
|
|||
package com.tangem.domain.wallets.usecase
|
||||
|
||||
import com.tangem.common.TangemSiteUrlBuilder
|
||||
import com.tangem.domain.wallets.repository.WalletsPromoRepository
|
||||
import java.util.Locale
|
||||
|
||||
class GenerateBuyTangemCardLinkUseCase {
|
||||
class GenerateBuyTangemCardLinkUseCase(
|
||||
private val walletsPromoRepository: WalletsPromoRepository,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(source: Source): String {
|
||||
return invoke(source.utmCampaign)
|
||||
}
|
||||
|
||||
suspend operator fun invoke(utmCampaign: String?): String {
|
||||
val refCode = walletsPromoRepository.getReferralCodeIfExists()
|
||||
val refCodeTag = TangemSiteUrlBuilder.getRefCodeTag(refCode)
|
||||
val langCode = Locale.getDefault().language
|
||||
val utmTags = TangemSiteUrlBuilder.getUtmTags(utmCampaign)
|
||||
return "https://buy.tangem.com/$langCode?$utmTags"
|
||||
return "https://buy.tangem.com/$langCode?$utmTags&$refCodeTag"
|
||||
}
|
||||
|
||||
enum class Source(val utmCampaign: String) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue