From ee21f684ebb218652326de854cf727e0f1e62ce4 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 15 Oct 2024 03:14:21 +0200 Subject: [PATCH] Added constructor for Bank and BankAccount --- .../request/TransferMoneyRequestForUser.kt | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt index 4b81b477..7cf081d3 100644 --- a/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt +++ b/BankingClientModel/src/commonMain/kotlin/net/codinux/banking/client/model/request/TransferMoneyRequestForUser.kt @@ -1,8 +1,6 @@ package net.codinux.banking.client.model.request -import net.codinux.banking.client.model.Amount -import net.codinux.banking.client.model.BankAccountIdentifier -import net.codinux.banking.client.model.DefaultValues +import net.codinux.banking.client.model.* import net.codinux.banking.client.model.config.NoArgConstructor import net.codinux.banking.client.model.tan.TanMethodType @@ -45,5 +43,22 @@ open class TransferMoneyRequestForUser( : this(bankCode, loginName, password, request.senderAccount, request.recipientName, request.recipientAccountIdentifier, request.recipientBankIdentifier, request.amount, request.currency, request.paymentReference, request.instantTransfer, request.preferredTanMethods, request.tanMethodsNotSupportedByApplication) + constructor( + bank: BankAccess, account: BankAccount?, + recipientName: String, recipientAccountIdentifier: String, recipientBankIdentifier: String? = null, + amount: Amount, currency: String = DefaultValues.DefaultCurrency, paymentReference: String? = null, instantTransfer: Boolean = false + ) : this(bank.domesticBankCode, bank.loginName, bank.password!!, account?.let { BankAccountIdentifier(it.identifier, it.subAccountNumber, it.iban) }, + recipientName, recipientAccountIdentifier, recipientBankIdentifier, amount, currency, paymentReference, instantTransfer, + listOf(bank.selectedTanMethod.type) + TanMethodType.NonVisualOrImageBased) { + this.bank = bank + this.account = account + } + + open var bank: BankAccess? = null + protected set + + open var account: BankAccount? = null + protected set + override fun toString() = "$bankCode $loginName ${super.toString()}" } \ No newline at end of file