taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

CurrencySpecification.kt (1412B)


      1 /*
      2  * This file is part of GNU Taler
      3  * (C) 2024 Taler Systems S.A.
      4  *
      5  * GNU Taler is free software; you can redistribute it and/or modify it under the
      6  * terms of the GNU General Public License as published by the Free Software
      7  * Foundation; either version 3, or (at your option) any later version.
      8  *
      9  * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
     10  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11  * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License along with
     14  * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15  */
     16 
     17 package net.taler.common
     18 
     19 import kotlinx.serialization.SerialName
     20 import kotlinx.serialization.Serializable
     21 
     22 @Serializable
     23 data class CurrencySpecification(
     24     val name: String,
     25     @SerialName("num_fractional_input_digits")
     26     val numFractionalInputDigits: Int,
     27     @SerialName("num_fractional_normal_digits")
     28     val numFractionalNormalDigits: Int,
     29     @SerialName("num_fractional_trailing_zero_digits")
     30     val numFractionalTrailingZeroDigits: Int,
     31     @SerialName("alt_unit_names")
     32     val altUnitNames: Map<Int, String>,
     33     @SerialName("common_amounts")
     34     val commonAmounts: List<Amount>? = null,
     35 ) {
     36     // TODO: add support for alt units
     37     val symbol: String? get() = altUnitNames[0]
     38 }