model.request.CreateCurrency.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tatum-java Show documentation
Show all versions of tatum-java Show documentation
Tatum API client allows Java projects to interact with Tatum API.
package model.request
import MergedCurrency
import model.response.ledger.Fiat
import java.math.BigDecimal
internal val VC_REGEX = "^VC_[a-zA-Z0-9_]+\$".toRegex()
class CreateCurrency(
val name: String,
supply: BigDecimal,
val description: String? = null,
val accountCode: String? = null,
val basePair: MergedCurrency,
val baseRate: BigDecimal? = null,
val accountingCurrency: Fiat? = null,
val customer: CustomerUpdate? = null,
) {
init {
require(name.length in 1..30 && name.matches(VC_REGEX))
require(supply.toString().length <= 38)
if (description != null) require(description.length in 1..100)
if (accountCode != null) require(accountCode.length in 1..50)
if (baseRate != null) require(baseRate >= BigDecimal.ZERO)
}
val supply: String = supply.toString()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy