- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
when {
(defaultCurrency != null) -> {
when {
(currenciesList == null) -> {
currenciesList = mutableListOf(defaultCurrency)
}
(currenciesList?.isEmpty() == true) -> {
currenciesList?.add(defaultCurrency)
}
else -> {
if (currenciesList?.contains(defaultCurrency) == false) {
defaultCurrency = currenciesList?.first()
}
}
}
}
else -> {
when {
((currenciesList == null) || (currenciesList?.isEmpty() == true)) -> {
throw IllegalArgumentException("Default currency and list of currencies from terminal configuration are empty")
}
else -> {
defaultCurrency = currenciesList?.first()
}
}
}
}