Skip to content

Commit aa64eef

Browse files
committed
chore(services/flipcash): update UserFlags to consume newCurrencyPurchaseAmount
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 275e61f commit aa64eef

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

definitions/flipcash/protos/src/main/proto/account/v1/flipcash_account_service.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,6 @@ message UserFlags {
108108
uint32 min_build_number = 6;
109109
// Exchange data timeout for sequential give/grabs for bills
110110
google.protobuf.Duration bill_exchange_data_timeout = 7;
111+
// USDF amount, in quarks, that must be purchased when launching a new currency
112+
uint64 new_currency_purchase_amount = 8;
111113
}

services/flipcash/src/main/kotlin/com/flipcash/services/internal/domain/UserFlagsMapper.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import com.flipcash.services.internal.domain.mapper.Mapper
55
import com.flipcash.services.internal.model.account.UserFlags
66
import com.flipcash.services.internal.model.thirdparty.OnRampProvider
77
import com.flipcash.services.internal.model.thirdparty.OnRampType
8+
import com.getcode.opencode.model.financial.Fiat
9+
import com.getcode.opencode.model.financial.toFiat
810
import javax.inject.Inject
911
import kotlin.time.DurationUnit
1012
import kotlin.time.toDuration
@@ -20,6 +22,7 @@ internal class UserFlagsMapper @Inject constructor():
2022
supportedOnRampProviders = from.supportedOnRampProvidersList.map { it.toDomain() },
2123
minimumVersion = from.minBuildNumber,
2224
billExchangeDataTimeout = from.billExchangeDataTimeout.seconds.toDuration(DurationUnit.SECONDS),
25+
newCurrencyPurchaseAmount = Fiat(quarks = from.newCurrencyPurchaseAmount)
2326
)
2427
}
2528
}

services/flipcash/src/main/kotlin/com/flipcash/services/internal/model/account/UserFlags.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.flipcash.services.internal.model.account
22

33
import com.flipcash.services.internal.model.thirdparty.OnRampProvider
4+
import com.getcode.opencode.model.financial.Fiat
5+
import com.getcode.opencode.model.financial.toFiat
46
import kotlin.time.Duration
57

68
data class UserFlags(
@@ -11,6 +13,7 @@ data class UserFlags(
1113
val supportedOnRampProviders: List<OnRampProvider>,
1214
val minimumVersion: Int?,
1315
val billExchangeDataTimeout: Duration?,
16+
val newCurrencyPurchaseAmount: Fiat,
1417
) {
1518
companion object {
1619
val Default = UserFlags(
@@ -21,6 +24,7 @@ data class UserFlags(
2124
supportedOnRampProviders = emptyList(),
2225
minimumVersion = null,
2326
billExchangeDataTimeout = null,
27+
newCurrencyPurchaseAmount = Fiat.MAX_VALUE,
2428
)
2529
}
2630
}

0 commit comments

Comments
 (0)