Implemented CustomerData.addAccount()

This commit is contained in:
dankl 2020-01-19 17:01:26 +01:00 committed by dankito
parent 8b7456bb29
commit f55b84032e
2 changed files with 7 additions and 4 deletions

View File

@ -808,9 +808,7 @@ open class FinTsClient @JvmOverloads constructor(
accountInfo.accountType, accountInfo.currency, accountHolderName, accountInfo.productName, accountInfo.accountType, accountInfo.currency, accountHolderName, accountInfo.productName,
accountInfo.accountLimit, accountInfo.allowedJobNames) accountInfo.accountLimit, accountInfo.allowedJobNames)
val accounts = customer.accounts.toMutableList() customer.addAccount(newAccount)
accounts.add(newAccount)
customer.accounts = accounts
} }
// TODO: may also make use of other info // TODO: may also make use of other info

View File

@ -11,7 +11,7 @@ open class CustomerData(
val userId: String = customerId, val userId: String = customerId,
var name: String = "", var name: String = "",
var iban: String? = null, var iban: String? = null,
var accounts: List<AccountData> = listOf(), val accounts: List<AccountData> = mutableListOf(),
var updVersion: Int = UPDVersion.VersionNotReceivedYet, var updVersion: Int = UPDVersion.VersionNotReceivedYet,
var supportedTanProcedures: List<TanProcedure> = listOf(), var supportedTanProcedures: List<TanProcedure> = listOf(),
var selectedTanProcedure: TanProcedure = TanProcedureNotSelected, var selectedTanProcedure: TanProcedure = TanProcedureNotSelected,
@ -49,6 +49,11 @@ open class CustomerData(
} }
open fun addAccount(account: AccountData) {
(accounts as? MutableList)?.add(account)
}
override fun toString(): String { override fun toString(): String {
return customerId return customerId
} }