In UI renamed customerId to userName; removed unused customerId from BankAccount
This commit is contained in:
parent
d209bc46fc
commit
415a3297bb
|
@ -13,14 +13,14 @@ import net.dankito.banking.ui.model.tan.TanMethod
|
||||||
@Entity
|
@Entity
|
||||||
open class Bank(
|
open class Bank(
|
||||||
override var bankCode: String,
|
override var bankCode: String,
|
||||||
override var customerId: String,
|
override var userName: String,
|
||||||
override var password: String,
|
override var password: String,
|
||||||
override var finTsServerAddress: String,
|
override var finTsServerAddress: String,
|
||||||
override var bankName: String,
|
override var bankName: String,
|
||||||
override var bic: String,
|
override var bic: String,
|
||||||
override var customerName: String,
|
override var customerName: String,
|
||||||
|
|
||||||
override var userId: String = customerId,
|
override var userId: String = userName,
|
||||||
override var iconUrl: String? = null,
|
override var iconUrl: String? = null,
|
||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
|
|
|
@ -18,7 +18,6 @@ open class BankAccount(
|
||||||
override var accountHolderName: String,
|
override var accountHolderName: String,
|
||||||
override var iban: String?,
|
override var iban: String?,
|
||||||
override var subAccountNumber: String?,
|
override var subAccountNumber: String?,
|
||||||
override var customerId: String,
|
|
||||||
override var balance: BigDecimal = BigDecimal.Zero,
|
override var balance: BigDecimal = BigDecimal.Zero,
|
||||||
override var currency: String = "EUR",
|
override var currency: String = "EUR",
|
||||||
override var type: BankAccountType = BankAccountType.Girokonto,
|
override var type: BankAccountType = BankAccountType.Girokonto,
|
||||||
|
@ -45,7 +44,7 @@ open class BankAccount(
|
||||||
constructor(bank: TypedBankData, productName: String?, identifier: String) : this(bank, productName, identifier, BankAccountType.Girokonto)
|
constructor(bank: TypedBankData, productName: String?, identifier: String) : this(bank, productName, identifier, BankAccountType.Girokonto)
|
||||||
|
|
||||||
constructor(bank: TypedBankData, productName: String?, identifier: String, type: BankAccountType = BankAccountType.Girokonto, balance: BigDecimal = BigDecimal.Zero)
|
constructor(bank: TypedBankData, productName: String?, identifier: String, type: BankAccountType = BankAccountType.Girokonto, balance: BigDecimal = BigDecimal.Zero)
|
||||||
: this(bank, identifier, "", null, null, "", balance, "EUR", type, productName)
|
: this(bank, identifier, "", null, null, balance, "EUR", type, productName)
|
||||||
|
|
||||||
|
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
|
|
|
@ -12,10 +12,10 @@ import net.dankito.utils.multiplatform.Date
|
||||||
|
|
||||||
open class RoomModelCreator : IModelCreator {
|
open class RoomModelCreator : IModelCreator {
|
||||||
|
|
||||||
override fun createBank(bankCode: String, customerId: String, password: String, finTsServerAddress: String, bankName: String,
|
override fun createBank(bankCode: String, userName: String, password: String, finTsServerAddress: String, bankName: String,
|
||||||
bic: String, customerName: String, userId: String, iconUrl: String?): TypedBankData {
|
bic: String, customerName: String, userId: String, iconUrl: String?): TypedBankData {
|
||||||
|
|
||||||
return Bank(bankCode, customerId, password, finTsServerAddress, bankName, bic, customerName, userId, iconUrl)
|
return Bank(bankCode, userName, password, finTsServerAddress, bankName, bic, customerName, userId, iconUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createAccount(bank: TypedBankData, productName: String?, identifier: String): TypedBankAccount {
|
override fun createAccount(bank: TypedBankData, productName: String?, identifier: String): TypedBankAccount {
|
||||||
|
|
|
@ -13,15 +13,15 @@ import net.dankito.utils.multiplatform.Date
|
||||||
|
|
||||||
open class EntitiesModelCreator : IModelCreator {
|
open class EntitiesModelCreator : IModelCreator {
|
||||||
|
|
||||||
override fun createBank(bankCode: String, customerId: String, password: String, finTsServerAddress: String, bankName: String, bic: String,
|
override fun createBank(bankCode: String, userName: String, password: String, finTsServerAddress: String, bankName: String, bic: String,
|
||||||
customerName: String, userId: String, iconUrl: String?): TypedBankData {
|
customerName: String, userId: String, iconUrl: String?): TypedBankData {
|
||||||
|
|
||||||
return BankDataEntity(bankCode, customerId, password, finTsServerAddress, bankName, bic, customerName, userId, iconUrl) as TypedBankData
|
return BankDataEntity(bankCode, userName, password, finTsServerAddress, bankName, bic, customerName, userId, iconUrl) as TypedBankData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun createAccount(bank: TypedBankData, productName: String?, identifier: String): TypedBankAccount {
|
override fun createAccount(bank: TypedBankData, productName: String?, identifier: String): TypedBankAccount {
|
||||||
return BankAccountEntity(bank as BankDataEntity, identifier, "", null, null, "", productName = productName) as TypedBankAccount
|
return BankAccountEntity(bank as BankDataEntity, identifier, "", null, null, productName = productName) as TypedBankAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createTransaction(
|
override fun createTransaction(
|
||||||
|
|
|
@ -16,7 +16,6 @@ open class BankAccountEntity(
|
||||||
override var accountHolderName: String,
|
override var accountHolderName: String,
|
||||||
override var iban: String?,
|
override var iban: String?,
|
||||||
override var subAccountNumber: String?,
|
override var subAccountNumber: String?,
|
||||||
override var customerId: String,
|
|
||||||
override var balance: BigDecimal = BigDecimal.Zero,
|
override var balance: BigDecimal = BigDecimal.Zero,
|
||||||
override var currency: String = "EUR",
|
override var currency: String = "EUR",
|
||||||
override var type: BankAccountType = BankAccountType.Girokonto,
|
override var type: BankAccountType = BankAccountType.Girokonto,
|
||||||
|
@ -38,7 +37,7 @@ open class BankAccountEntity(
|
||||||
|
|
||||||
) : IBankAccount<AccountTransactionEntity> {
|
) : IBankAccount<AccountTransactionEntity> {
|
||||||
|
|
||||||
internal constructor() : this(BankDataEntity(), "", "", null, null, "") // for object deserializers
|
internal constructor() : this(BankDataEntity(), "", "", null, null) // for object deserializers
|
||||||
|
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
|
|
|
@ -11,13 +11,13 @@ import java.util.*
|
||||||
// had to define all properties as 'var' 'cause MapStruct cannot handle vals (and cannot use Pozo's mapstruct-kotlin as SerializableCustomerBuilder would fail with @Context)
|
// had to define all properties as 'var' 'cause MapStruct cannot handle vals (and cannot use Pozo's mapstruct-kotlin as SerializableCustomerBuilder would fail with @Context)
|
||||||
open class BankDataEntity(
|
open class BankDataEntity(
|
||||||
override var bankCode: String,
|
override var bankCode: String,
|
||||||
override var customerId: String,
|
override var userName: String,
|
||||||
override var password: String,
|
override var password: String,
|
||||||
override var finTsServerAddress: String,
|
override var finTsServerAddress: String,
|
||||||
override var bankName: String,
|
override var bankName: String,
|
||||||
override var bic: String,
|
override var bic: String,
|
||||||
override var customerName: String,
|
override var customerName: String,
|
||||||
override var userId: String = customerId,
|
override var userId: String = userName,
|
||||||
override var iconUrl: String? = null,
|
override var iconUrl: String? = null,
|
||||||
override var accounts: List<BankAccountEntity> = listOf(),
|
override var accounts: List<BankAccountEntity> = listOf(),
|
||||||
override var supportedTanMethods: List<TanMethod> = listOf(),
|
override var supportedTanMethods: List<TanMethod> = listOf(),
|
||||||
|
|
|
@ -132,8 +132,8 @@ class BankingPersistenceJsonTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createAccount(productName: String, customer: BankDataEntity, countTransactions: Int = 0): BankAccountEntity {
|
private fun createAccount(productName: String, customer: BankDataEntity, countTransactions: Int = 0): BankAccountEntity {
|
||||||
val result = BankAccountEntity(customer, customer.customerId, "AccountHolder", "DE00" + customer.bankCode + customer.customerId, null,
|
val result = BankAccountEntity(customer, customer.userName, "AccountHolder", "DE00" + customer.bankCode + customer.userName, null,
|
||||||
customer.customerId, BigDecimal(84.25), productName = productName)
|
BigDecimal(84.25), productName = productName)
|
||||||
|
|
||||||
result.bookedTransactions = createTransactions(countTransactions, result)
|
result.bookedTransactions = createTransactions(countTransactions, result)
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ class BankingPersistenceJsonTest {
|
||||||
|
|
||||||
private fun assertBanksEqual(deserializedBank: BankDataEntity, bank: BankDataEntity) {
|
private fun assertBanksEqual(deserializedBank: BankDataEntity, bank: BankDataEntity) {
|
||||||
assertThat(deserializedBank.bankCode).isEqualTo(bank.bankCode)
|
assertThat(deserializedBank.bankCode).isEqualTo(bank.bankCode)
|
||||||
assertThat(deserializedBank.customerId).isEqualTo(bank.customerId)
|
assertThat(deserializedBank.userName).isEqualTo(bank.userName)
|
||||||
assertThat(deserializedBank.password).isEqualTo(bank.password)
|
assertThat(deserializedBank.password).isEqualTo(bank.password)
|
||||||
assertThat(deserializedBank.finTsServerAddress).isEqualTo(bank.finTsServerAddress)
|
assertThat(deserializedBank.finTsServerAddress).isEqualTo(bank.finTsServerAddress)
|
||||||
|
|
||||||
|
@ -206,7 +206,6 @@ class BankingPersistenceJsonTest {
|
||||||
|
|
||||||
assertThat(deserializedAccount.identifier).isEqualTo(account.identifier)
|
assertThat(deserializedAccount.identifier).isEqualTo(account.identifier)
|
||||||
assertThat(deserializedAccount.iban).isEqualTo(account.iban)
|
assertThat(deserializedAccount.iban).isEqualTo(account.iban)
|
||||||
assertThat(deserializedAccount.customerId).isEqualTo(account.customerId)
|
|
||||||
assertThat(deserializedAccount.balance).isEqualTo(account.balance)
|
assertThat(deserializedAccount.balance).isEqualTo(account.balance)
|
||||||
assertThat(deserializedAccount.productName).isEqualTo(account.productName)
|
assertThat(deserializedAccount.productName).isEqualTo(account.productName)
|
||||||
|
|
||||||
|
|
|
@ -69,11 +69,11 @@ open class AddAccountDialog : DialogFragment() {
|
||||||
rootView.apply {
|
rootView.apply {
|
||||||
initBankListAutocompletion(edtxtBank.actualEditText)
|
initBankListAutocompletion(edtxtBank.actualEditText)
|
||||||
|
|
||||||
edtxtCustomerId.actualEditText.addTextChangedListener(otherEditTextChangedWatcher)
|
edtxtUserName.actualEditText.addTextChangedListener(otherEditTextChangedWatcher)
|
||||||
edtxtPassword.actualEditText.addTextChangedListener(otherEditTextChangedWatcher)
|
edtxtPassword.actualEditText.addTextChangedListener(otherEditTextChangedWatcher)
|
||||||
|
|
||||||
addAccountIfEnterPressed(edtxtBank.actualEditText)
|
addAccountIfEnterPressed(edtxtBank.actualEditText)
|
||||||
addAccountIfEnterPressed(edtxtCustomerId.actualEditText)
|
addAccountIfEnterPressed(edtxtUserName.actualEditText)
|
||||||
addAccountIfEnterPressed(edtxtPassword.actualEditText)
|
addAccountIfEnterPressed(edtxtPassword.actualEditText)
|
||||||
|
|
||||||
btnAddAccount.setOnClickListener { addAccount() }
|
btnAddAccount.setOnClickListener { addAccount() }
|
||||||
|
@ -111,13 +111,13 @@ open class AddAccountDialog : DialogFragment() {
|
||||||
|
|
||||||
protected open fun addAccount() {
|
protected open fun addAccount() {
|
||||||
selectedBank?.let { selectedBank -> // should always be non-null at this stage
|
selectedBank?.let { selectedBank -> // should always be non-null at this stage
|
||||||
val customerId = edtxtCustomerId.text
|
val userName = edtxtUserName.text
|
||||||
val password = edtxtPassword.text
|
val password = edtxtPassword.text
|
||||||
|
|
||||||
btnAddAccount.isEnabled = false
|
btnAddAccount.isEnabled = false
|
||||||
pgrbrAddAccount.visibility = View.VISIBLE
|
pgrbrAddAccount.visibility = View.VISIBLE
|
||||||
|
|
||||||
presenter.addAccountAsync(selectedBank, customerId, password) { response ->
|
presenter.addAccountAsync(selectedBank, userName, password) { response ->
|
||||||
context?.asActivity()?.runOnUiThread {
|
context?.asActivity()?.runOnUiThread {
|
||||||
btnAddAccount.isEnabled = true
|
btnAddAccount.isEnabled = true
|
||||||
pgrbrAddAccount.visibility = View.GONE
|
pgrbrAddAccount.visibility = View.GONE
|
||||||
|
@ -160,7 +160,7 @@ open class AddAccountDialog : DialogFragment() {
|
||||||
|
|
||||||
edtxtBank.text = bank.name
|
edtxtBank.text = bank.name
|
||||||
|
|
||||||
edtxtCustomerId.requestFocus()
|
edtxtUserName.requestFocus()
|
||||||
|
|
||||||
checkIfRequiredDataEnteredOnUiThread()
|
checkIfRequiredDataEnteredOnUiThread()
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ open class AddAccountDialog : DialogFragment() {
|
||||||
protected open fun checkIfRequiredDataEnteredOnUiThread() {
|
protected open fun checkIfRequiredDataEnteredOnUiThread() {
|
||||||
val requiredDataEntered = selectedBank != null
|
val requiredDataEntered = selectedBank != null
|
||||||
&& selectedBank?.supportsFinTs3_0 == true
|
&& selectedBank?.supportsFinTs3_0 == true
|
||||||
&& edtxtCustomerId.text.isNotEmpty()
|
&& edtxtUserName.text.isNotEmpty()
|
||||||
&& edtxtPassword.text.isNotEmpty()
|
&& edtxtPassword.text.isNotEmpty()
|
||||||
|
|
||||||
btnAddAccount.isEnabled = requiredDataEntered
|
btnAddAccount.isEnabled = requiredDataEntered
|
||||||
|
|
|
@ -5,7 +5,7 @@ import android.view.*
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import kotlinx.android.synthetic.main.dialog_bank_settings.edtxtBankName
|
import kotlinx.android.synthetic.main.dialog_bank_settings.edtxtBankName
|
||||||
import kotlinx.android.synthetic.main.dialog_bank_settings.edtxtCustomerId
|
import kotlinx.android.synthetic.main.dialog_bank_settings.edtxtUserName
|
||||||
import kotlinx.android.synthetic.main.dialog_bank_settings.edtxtPassword
|
import kotlinx.android.synthetic.main.dialog_bank_settings.edtxtPassword
|
||||||
import kotlinx.android.synthetic.main.dialog_bank_settings.view.*
|
import kotlinx.android.synthetic.main.dialog_bank_settings.view.*
|
||||||
import net.dankito.banking.ui.android.R
|
import net.dankito.banking.ui.android.R
|
||||||
|
@ -68,7 +68,7 @@ open class BankSettingsDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
edtxtBankName.text = bank.displayName
|
edtxtBankName.text = bank.displayName
|
||||||
edtxtCustomerId.text = bank.customerId
|
edtxtUserName.text = bank.userName
|
||||||
edtxtPassword.text = bank.password
|
edtxtPassword.text = bank.password
|
||||||
|
|
||||||
btnDeleteAccount.setOnClickListener { askUserToDeleteAccount() }
|
btnDeleteAccount.setOnClickListener { askUserToDeleteAccount() }
|
||||||
|
@ -86,7 +86,7 @@ open class BankSettingsDialog : DialogFragment() {
|
||||||
|
|
||||||
protected val hasUnsavedChanges: Boolean
|
protected val hasUnsavedChanges: Boolean
|
||||||
get() = didChange(edtxtBankName, bank.displayName)
|
get() = didChange(edtxtBankName, bank.displayName)
|
||||||
|| didChange(edtxtCustomerId, bank.customerId)
|
|| didChange(edtxtUserName, bank.userName)
|
||||||
|| didChange(edtxtPassword, bank.password)
|
|| didChange(edtxtPassword, bank.password)
|
||||||
|
|
||||||
protected open fun didChange(editedValue: FormEditText, originalValue: String): Boolean {
|
protected open fun didChange(editedValue: FormEditText, originalValue: String): Boolean {
|
||||||
|
@ -105,7 +105,7 @@ open class BankSettingsDialog : DialogFragment() {
|
||||||
|
|
||||||
protected open fun saveChanges() {
|
protected open fun saveChanges() {
|
||||||
bank.userSetDisplayName = edtxtBankName.text
|
bank.userSetDisplayName = edtxtBankName.text
|
||||||
bank.customerId = edtxtCustomerId.text
|
bank.userName = edtxtUserName.text
|
||||||
bank.password = edtxtPassword.text
|
bank.password = edtxtPassword.text
|
||||||
|
|
||||||
presenter.bankUpdated(bank)
|
presenter.bankUpdated(bank)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
|
|
||||||
<net.dankito.banking.ui.android.views.FormEditText
|
<net.dankito.banking.ui.android.views.FormEditText
|
||||||
android:id="@+id/edtxtCustomerId"
|
android:id="@+id/edtxtUserName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/online_banking_credentials_login_name"
|
android:hint="@string/online_banking_credentials_login_name"
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
|
|
||||||
<net.dankito.banking.ui.android.views.FormEditText
|
<net.dankito.banking.ui.android.views.FormEditText
|
||||||
android:id="@+id/edtxtCustomerId"
|
android:id="@+id/edtxtUserName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/online_banking_credentials_login_name"
|
android:hint="@string/online_banking_credentials_login_name"
|
||||||
|
@ -87,7 +87,6 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -51,7 +51,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
|
||||||
|
|
||||||
protected var lastSearchBanksJob: Job? = null
|
protected var lastSearchBanksJob: Job? = null
|
||||||
|
|
||||||
protected val customerId = SimpleStringProperty("")
|
protected val userName = SimpleStringProperty("")
|
||||||
|
|
||||||
protected val password = SimpleStringProperty("")
|
protected val password = SimpleStringProperty("")
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
|
||||||
init {
|
init {
|
||||||
bankName.addListener { _, _, newValue -> searchBanks(newValue) }
|
bankName.addListener { _, _, newValue -> searchBanks(newValue) }
|
||||||
|
|
||||||
customerId.addListener { _, _, _ -> checkIfRequiredDataHasBeenEntered() }
|
userName.addListener { _, _, _ -> checkIfRequiredDataHasBeenEntered() }
|
||||||
|
|
||||||
password.addListener { _, _, _ -> checkIfRequiredDataHasBeenEntered() }
|
password.addListener { _, _, _ -> checkIfRequiredDataHasBeenEntered() }
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
textfield(customerId) {
|
textfield(userName) {
|
||||||
promptText = messages["add.account.dialog.customer.id.hint"]
|
promptText = messages["add.account.dialog.customer.id.hint"]
|
||||||
prefHeight = TextFieldHeight
|
prefHeight = TextFieldHeight
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
|
||||||
protected open fun checkIfRequiredDataHasBeenEntered() {
|
protected open fun checkIfRequiredDataHasBeenEntered() {
|
||||||
requiredDataHasBeenEntered.value = selectedBank != null
|
requiredDataHasBeenEntered.value = selectedBank != null
|
||||||
&& selectedBank?.supportsFinTs3_0 == true
|
&& selectedBank?.supportsFinTs3_0 == true
|
||||||
&& customerId.value.isNotEmpty() // TODO: check if it is of length 10?
|
&& userName.value.isNotEmpty() // TODO: check if it is of length 10?
|
||||||
&& password.value.isNotEmpty() // TODO: check if it is of length 5?
|
&& password.value.isNotEmpty() // TODO: check if it is of length 5?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
|
||||||
isEnteredCredentialsResultVisible.value = false
|
isEnteredCredentialsResultVisible.value = false
|
||||||
|
|
||||||
selectedBank?.let {
|
selectedBank?.let {
|
||||||
presenter.addAccountAsync(it, customerId.value, password.value) { response ->
|
presenter.addAccountAsync(it, userName.value, password.value) { response ->
|
||||||
runLater { handleAddAccountResultOnUiThread(response) }
|
runLater { handleAddAccountResultOnUiThread(response) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window(
|
||||||
val account = response.bank
|
val account = response.bank
|
||||||
|
|
||||||
checkEnteredCredentialsResult.value = String.format(messages["add.account.dialog.error.could.not.add.account"],
|
checkEnteredCredentialsResult.value = String.format(messages["add.account.dialog.error.could.not.add.account"],
|
||||||
account.bankCode, account.customerId, response.errorToShowToUser)
|
account.bankCode, account.userName, response.errorToShowToUser)
|
||||||
|
|
||||||
isEnteredCredentialsResultVisible.value = true
|
isEnteredCredentialsResultVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ open class BankAccount @JvmOverloads constructor(
|
||||||
override var accountHolderName: String,
|
override var accountHolderName: String,
|
||||||
override var iban: String?,
|
override var iban: String?,
|
||||||
override var subAccountNumber: String?,
|
override var subAccountNumber: String?,
|
||||||
override var customerId: String,
|
|
||||||
override var balance: BigDecimal = BigDecimal.Zero,
|
override var balance: BigDecimal = BigDecimal.Zero,
|
||||||
override var currency: String = "EUR",
|
override var currency: String = "EUR",
|
||||||
override var type: BankAccountType = BankAccountType.Girokonto,
|
override var type: BankAccountType = BankAccountType.Girokonto,
|
||||||
|
@ -35,7 +34,7 @@ open class BankAccount @JvmOverloads constructor(
|
||||||
constructor(bank: TypedBankData, productName: String?, identifier: String) : this(bank, productName, identifier, BankAccountType.Girokonto)
|
constructor(bank: TypedBankData, productName: String?, identifier: String) : this(bank, productName, identifier, BankAccountType.Girokonto)
|
||||||
|
|
||||||
constructor(bank: TypedBankData, productName: String?, identifier: String, type: BankAccountType = BankAccountType.Girokonto, balance: BigDecimal = BigDecimal.Zero)
|
constructor(bank: TypedBankData, productName: String?, identifier: String, type: BankAccountType = BankAccountType.Girokonto, balance: BigDecimal = BigDecimal.Zero)
|
||||||
: this(bank, identifier, "", null, null, "", balance, "EUR", type, productName)
|
: this(bank, identifier, "", null, null, balance, "EUR", type, productName)
|
||||||
|
|
||||||
|
|
||||||
override var technicalId: String = UUID.random()
|
override var technicalId: String = UUID.random()
|
||||||
|
|
|
@ -7,13 +7,13 @@ import net.dankito.utils.multiplatform.UUID
|
||||||
|
|
||||||
open class BankData(
|
open class BankData(
|
||||||
override var bankCode: String,
|
override var bankCode: String,
|
||||||
override var customerId: String,
|
override var userName: String,
|
||||||
override var password: String,
|
override var password: String,
|
||||||
override var finTsServerAddress: String,
|
override var finTsServerAddress: String,
|
||||||
override var bankName: String,
|
override var bankName: String,
|
||||||
override var bic: String,
|
override var bic: String,
|
||||||
override var customerName: String,
|
override var customerName: String,
|
||||||
override var userId: String = customerId,
|
override var userId: String = userName,
|
||||||
override var iconUrl: String? = null,
|
override var iconUrl: String? = null,
|
||||||
override var accounts: List<TypedBankAccount> = listOf()
|
override var accounts: List<TypedBankAccount> = listOf()
|
||||||
) : TypedBankData {
|
) : TypedBankData {
|
||||||
|
@ -23,8 +23,8 @@ open class BankData(
|
||||||
|
|
||||||
/* convenience constructors for languages not supporting default values */
|
/* convenience constructors for languages not supporting default values */
|
||||||
|
|
||||||
constructor(bankCode: String, customerId: String, password: String, finTsServerAddress: String)
|
constructor(bankCode: String, userName: String, password: String, finTsServerAddress: String)
|
||||||
: this(bankCode, customerId, password, finTsServerAddress, "", "", "")
|
: this(bankCode, userName, password, finTsServerAddress, "", "", "")
|
||||||
|
|
||||||
|
|
||||||
override var technicalId: String = UUID.random()
|
override var technicalId: String = UUID.random()
|
||||||
|
|
|
@ -13,7 +13,6 @@ interface IBankAccount<TTransaction: IAccountTransaction> : OrderedDisplayable {
|
||||||
var accountHolderName: String
|
var accountHolderName: String
|
||||||
var iban: String?
|
var iban: String?
|
||||||
var subAccountNumber: String?
|
var subAccountNumber: String?
|
||||||
var customerId: String
|
|
||||||
var balance: BigDecimal
|
var balance: BigDecimal
|
||||||
var currency: String
|
var currency: String
|
||||||
var type: BankAccountType
|
var type: BankAccountType
|
||||||
|
|
|
@ -14,7 +14,7 @@ typealias TypedBankData = IBankData<IBankAccount<IAccountTransaction>, IAccountT
|
||||||
interface IBankData<TAccount: IBankAccount<TAccountTransaction>, TAccountTransaction: IAccountTransaction> : OrderedDisplayable {
|
interface IBankData<TAccount: IBankAccount<TAccountTransaction>, TAccountTransaction: IAccountTransaction> : OrderedDisplayable {
|
||||||
|
|
||||||
var bankCode: String
|
var bankCode: String
|
||||||
var customerId: String
|
var userName: String
|
||||||
var password: String
|
var password: String
|
||||||
var finTsServerAddress: String
|
var finTsServerAddress: String
|
||||||
|
|
||||||
|
@ -58,6 +58,6 @@ interface IBankData<TAccount: IBankAccount<TAccountTransaction>, TAccountTransac
|
||||||
|
|
||||||
|
|
||||||
val stringRepresentation: String
|
val stringRepresentation: String
|
||||||
get() = "$bankName $customerId"
|
get() = "$bankName $userName"
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,10 +7,10 @@ import net.dankito.utils.multiplatform.Date
|
||||||
|
|
||||||
open class DefaultModelCreator : IModelCreator {
|
open class DefaultModelCreator : IModelCreator {
|
||||||
|
|
||||||
override fun createBank(bankCode: String, customerId: String, password: String, finTsServerAddress: String, bankName: String, bic: String,
|
override fun createBank(bankCode: String, userName: String, password: String, finTsServerAddress: String, bankName: String, bic: String,
|
||||||
customerName: String, userId: String, iconUrl: String?): TypedBankData {
|
customerName: String, userId: String, iconUrl: String?): TypedBankData {
|
||||||
|
|
||||||
return BankData(bankCode, customerId, password, finTsServerAddress, bankName, bic, customerName, userId, iconUrl)
|
return BankData(bankCode, userName, password, finTsServerAddress, bankName, bic, customerName, userId, iconUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ import net.dankito.utils.multiplatform.Date
|
||||||
|
|
||||||
interface IModelCreator {
|
interface IModelCreator {
|
||||||
|
|
||||||
fun createBank(bankCode: String, customerId: String, password: String, finTsServerAddress: String, bankName: String, bic: String,
|
fun createBank(bankCode: String, userName: String, password: String, finTsServerAddress: String, bankName: String, bic: String,
|
||||||
customerName: String = "", userId: String = customerId, iconUrl: String? = null): TypedBankData
|
customerName: String = "", userId: String = userName, iconUrl: String? = null): TypedBankData
|
||||||
|
|
||||||
|
|
||||||
fun createAccount(bank: TypedBankData, productName: String?, identifier: String) : TypedBankAccount
|
fun createAccount(bank: TypedBankData, productName: String?, identifier: String) : TypedBankAccount
|
||||||
|
|
|
@ -146,8 +146,8 @@ open class BankingPresenter(
|
||||||
|
|
||||||
|
|
||||||
// TODO: move BankInfo out of fints4k
|
// TODO: move BankInfo out of fints4k
|
||||||
open fun addAccountAsync(bankInfo: BankInfo, customerId: String, password: String, callback: (AddAccountResponse) -> Unit) {
|
open fun addAccountAsync(bankInfo: BankInfo, userName: String, password: String, callback: (AddAccountResponse) -> Unit) {
|
||||||
val bank = modelCreator.createBank(bankInfo.bankCode, customerId, password, bankInfo.pinTanAddress ?: "", bankInfo.name, bankInfo.bic, "")
|
val bank = modelCreator.createBank(bankInfo.bankCode, userName, password, bankInfo.pinTanAddress ?: "", bankInfo.name, bankInfo.bic, "")
|
||||||
|
|
||||||
val newClient = bankingClientCreator.createClient(bank, dataFolder, asyncRunner, this.callback)
|
val newClient = bankingClientCreator.createClient(bank, dataFolder, asyncRunner, this.callback)
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ open class BankingPresenter(
|
||||||
bankDisplayIndexUpdated(bank)
|
bankDisplayIndexUpdated(bank)
|
||||||
}
|
}
|
||||||
|
|
||||||
client?.deletedBank(bank, allBanks.firstOrNull { it.customerId == bank.customerId && it.bankCode == bank.bankCode} == null)
|
client?.deletedBank(bank, allBanks.firstOrNull { it.userName == bank.userName && it.bankCode == bank.bankCode} == null)
|
||||||
|
|
||||||
callBanksChangedListeners()
|
callBanksChangedListeners()
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,11 @@
|
||||||
<attribute name="accountLimit" optional="YES" attributeType="String"/>
|
<attribute name="accountLimit" optional="YES" attributeType="String"/>
|
||||||
<attribute name="balance" attributeType="Decimal" defaultValueString="0.0"/>
|
<attribute name="balance" attributeType="Decimal" defaultValueString="0.0"/>
|
||||||
<attribute name="currency" attributeType="String"/>
|
<attribute name="currency" attributeType="String"/>
|
||||||
<attribute name="customerId" attributeType="String"/>
|
|
||||||
<attribute name="displayIndex" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
<attribute name="displayIndex" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||||
<attribute name="haveAllTransactionsBeenFetched" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
<attribute name="haveAllTransactionsBeenRetrieved" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||||
<attribute name="iban" optional="YES" attributeType="String"/>
|
<attribute name="iban" optional="YES" attributeType="String"/>
|
||||||
<attribute name="identifier" attributeType="String"/>
|
<attribute name="identifier" attributeType="String"/>
|
||||||
<attribute name="isAccountTypeSupported" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
<attribute name="isAccountTypeSupportedByApplication" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
||||||
<attribute name="productName" optional="YES" attributeType="String"/>
|
<attribute name="productName" optional="YES" attributeType="String"/>
|
||||||
<attribute name="retrievedTransactionsFromOn" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
<attribute name="retrievedTransactionsFromOn" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
||||||
<attribute name="retrievedTransactionsUpTo" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
<attribute name="retrievedTransactionsUpTo" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
|
||||||
|
@ -65,7 +64,6 @@
|
||||||
<attribute name="bankName" attributeType="String"/>
|
<attribute name="bankName" attributeType="String"/>
|
||||||
<attribute name="bic" attributeType="String"/>
|
<attribute name="bic" attributeType="String"/>
|
||||||
<attribute name="countDaysForWhichTransactionsAreKept" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO"/>
|
<attribute name="countDaysForWhichTransactionsAreKept" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO"/>
|
||||||
<attribute name="customerId" attributeType="String"/>
|
|
||||||
<attribute name="customerName" attributeType="String"/>
|
<attribute name="customerName" attributeType="String"/>
|
||||||
<attribute name="displayIndex" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
<attribute name="displayIndex" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||||
<attribute name="finTsServerAddress" attributeType="String"/>
|
<attribute name="finTsServerAddress" attributeType="String"/>
|
||||||
|
@ -73,6 +71,7 @@
|
||||||
<attribute name="password" attributeType="String"/>
|
<attribute name="password" attributeType="String"/>
|
||||||
<attribute name="selectedTanMethodCode" optional="YES" attributeType="String"/>
|
<attribute name="selectedTanMethodCode" optional="YES" attributeType="String"/>
|
||||||
<attribute name="userId" attributeType="String"/>
|
<attribute name="userId" attributeType="String"/>
|
||||||
|
<attribute name="userName" attributeType="String"/>
|
||||||
<attribute name="userSetDisplayName" optional="YES" attributeType="String"/>
|
<attribute name="userSetDisplayName" optional="YES" attributeType="String"/>
|
||||||
<relationship name="accounts" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedBankAccount" inverseName="bank" inverseEntity="PersistedBankAccount"/>
|
<relationship name="accounts" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedBankAccount" inverseName="bank" inverseEntity="PersistedBankAccount"/>
|
||||||
<relationship name="supportedTanMethods" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedTanMethod"/>
|
<relationship name="supportedTanMethods" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedTanMethod"/>
|
||||||
|
@ -91,7 +90,7 @@
|
||||||
</entity>
|
</entity>
|
||||||
<elements>
|
<elements>
|
||||||
<element name="PersistedAccountTransaction" positionX="-36" positionY="45" width="128" height="553"/>
|
<element name="PersistedAccountTransaction" positionX="-36" positionY="45" width="128" height="553"/>
|
||||||
<element name="PersistedBankAccount" positionX="-54" positionY="63" width="128" height="373"/>
|
<element name="PersistedBankAccount" positionX="-54" positionY="63" width="128" height="358"/>
|
||||||
<element name="PersistedBankData" positionX="-63" positionY="-18" width="128" height="283"/>
|
<element name="PersistedBankData" positionX="-63" positionY="-18" width="128" height="283"/>
|
||||||
<element name="PersistedTanMedium" positionX="-45" positionY="144" width="128" height="28"/>
|
<element name="PersistedTanMedium" positionX="-45" positionY="144" width="128" height="28"/>
|
||||||
<element name="PersistedTanMethod" positionX="-54" positionY="135" width="128" height="118"/>
|
<element name="PersistedTanMethod" positionX="-54" positionY="135" width="128" height="118"/>
|
||||||
|
|
|
@ -16,7 +16,7 @@ let previewFlickerCodeTanChallenge = FlickerCodeTanChallenge(flickerCode: Flicke
|
||||||
|
|
||||||
|
|
||||||
func createPreviewBanks() -> [IBankData] {
|
func createPreviewBanks() -> [IBankData] {
|
||||||
let bank1 = BankData(bankCode: "", customerId: "", password: "", finTsServerAddress: "", bankName: "Abzockbank", bic: "", customerName: "Marieke Musterfrau", userId: "", iconUrl: "", accounts: [])
|
let bank1 = BankData(bankCode: "", userName: "", password: "", finTsServerAddress: "", bankName: "Abzockbank", bic: "", customerName: "Marieke Musterfrau", userId: "", iconUrl: "", accounts: [])
|
||||||
|
|
||||||
bank1.accounts = [
|
bank1.accounts = [
|
||||||
BankAccount(bank: bank1, productName: "Girokonto", identifier: "1234567890"),
|
BankAccount(bank: bank1, productName: "Girokonto", identifier: "1234567890"),
|
||||||
|
@ -25,7 +25,7 @@ func createPreviewBanks() -> [IBankData] {
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
let bank2 = BankData(bankCode: "", customerId: "", password: "", finTsServerAddress: "", bankName: "Kundenverarschebank", bic: "", customerName: "Marieke Musterfrau", userId: "", iconUrl: "", accounts: [])
|
let bank2 = BankData(bankCode: "", userName: "", password: "", finTsServerAddress: "", bankName: "Kundenverarschebank", bic: "", customerName: "Marieke Musterfrau", userId: "", iconUrl: "", accounts: [])
|
||||||
|
|
||||||
bank2.accounts = [
|
bank2.accounts = [
|
||||||
BankAccount(bank: bank2, productName: "Girokonto", identifier: "1234567890")
|
BankAccount(bank: bank2, productName: "Girokonto", identifier: "1234567890")
|
||||||
|
|
|
@ -6,7 +6,7 @@ import BankingUiSwift
|
||||||
class Mapper {
|
class Mapper {
|
||||||
|
|
||||||
func map(_ bank: PersistedBankData) -> IBankData {
|
func map(_ bank: PersistedBankData) -> IBankData {
|
||||||
let mapped = BankData(bankCode: map(bank.bankCode), customerId: map(bank.customerId), password: map(bank.password), finTsServerAddress: map(bank.finTsServerAddress), bankName: map(bank.bankName), bic: map(bank.bic), customerName: map(bank.customerName), userId: map(bank.userId), iconUrl: bank.iconUrl, accounts: [])
|
let mapped = BankData(bankCode: map(bank.bankCode), userName: map(bank.userName), password: map(bank.password), finTsServerAddress: map(bank.finTsServerAddress), bankName: map(bank.bankName), bic: map(bank.bic), customerName: map(bank.customerName), userId: map(bank.userId), iconUrl: bank.iconUrl, accounts: [])
|
||||||
|
|
||||||
mapped.countDaysForWhichTransactionsAreKept = mapToInt(bank.countDaysForWhichTransactionsAreKept)
|
mapped.countDaysForWhichTransactionsAreKept = mapToInt(bank.countDaysForWhichTransactionsAreKept)
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class Mapper {
|
||||||
let mapped = context.objectByID(bank.technicalId) ?? PersistedBankData(context: context)
|
let mapped = context.objectByID(bank.technicalId) ?? PersistedBankData(context: context)
|
||||||
|
|
||||||
mapped.bankCode = bank.bankCode
|
mapped.bankCode = bank.bankCode
|
||||||
mapped.customerId = bank.customerId
|
mapped.userName = bank.userName
|
||||||
mapped.password = bank.password
|
mapped.password = bank.password
|
||||||
mapped.finTsServerAddress = bank.finTsServerAddress
|
mapped.finTsServerAddress = bank.finTsServerAddress
|
||||||
mapped.bankName = bank.bankName
|
mapped.bankName = bank.bankName
|
||||||
|
@ -58,7 +58,7 @@ class Mapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
func map(_ bank: IBankData, _ account: PersistedBankAccount) -> IBankAccount {
|
func map(_ bank: IBankData, _ account: PersistedBankAccount) -> IBankAccount {
|
||||||
let mapped = BankAccount(bank: bank, identifier: map(account.identifier), accountHolderName: map(account.accountHolderName), iban: account.iban, subAccountNumber: account.subAccountNumber, customerId: map(account.customerId), balance: map(account.balance), currency: map(account.currency), type: map(account.type), productName: account.productName, accountLimit: account.accountLimit, retrievedTransactionsFromOn: map(account.retrievedTransactionsFromOn), retrievedTransactionsUpTo: map(account.retrievedTransactionsUpTo), supportsRetrievingAccountTransactions: account.supportsRetrievingAccountTransactions, supportsRetrievingBalance: account.supportsRetrievingBalance, supportsTransferringMoney: account.supportsTransferringMoney, supportsRealTimeTransfer: account.supportsRealTimeTransfer, bookedTransactions: [], unbookedTransactions: [])
|
let mapped = BankAccount(bank: bank, identifier: map(account.identifier), accountHolderName: map(account.accountHolderName), iban: account.iban, subAccountNumber: account.subAccountNumber, balance: map(account.balance), currency: map(account.currency), type: map(account.type), productName: account.productName, accountLimit: account.accountLimit, retrievedTransactionsFromOn: map(account.retrievedTransactionsFromOn), retrievedTransactionsUpTo: map(account.retrievedTransactionsUpTo), supportsRetrievingAccountTransactions: account.supportsRetrievingAccountTransactions, supportsRetrievingBalance: account.supportsRetrievingBalance, supportsTransferringMoney: account.supportsTransferringMoney, supportsRealTimeTransfer: account.supportsRealTimeTransfer, bookedTransactions: [], unbookedTransactions: [])
|
||||||
|
|
||||||
mapped.haveAllTransactionsBeenRetrieved = account.haveAllTransactionsBeenRetrieved
|
mapped.haveAllTransactionsBeenRetrieved = account.haveAllTransactionsBeenRetrieved
|
||||||
mapped.isAccountTypeSupportedByApplication = account.isAccountTypeSupportedByApplication
|
mapped.isAccountTypeSupportedByApplication = account.isAccountTypeSupportedByApplication
|
||||||
|
@ -85,7 +85,6 @@ class Mapper {
|
||||||
mapped.accountHolderName = account.accountHolderName
|
mapped.accountHolderName = account.accountHolderName
|
||||||
mapped.iban = account.iban
|
mapped.iban = account.iban
|
||||||
mapped.subAccountNumber = account.subAccountNumber
|
mapped.subAccountNumber = account.subAccountNumber
|
||||||
mapped.customerId = account.customerId
|
|
||||||
mapped.balance = account.balance.decimal
|
mapped.balance = account.balance.decimal
|
||||||
mapped.currency = account.currency
|
mapped.currency = account.currency
|
||||||
mapped.type = map(account.type)
|
mapped.type = map(account.type)
|
||||||
|
|
|
@ -7,7 +7,7 @@ struct AddAccountDialog: View {
|
||||||
|
|
||||||
@State private var bank: BankInfo? = nil
|
@State private var bank: BankInfo? = nil
|
||||||
|
|
||||||
@State private var customerId = ""
|
@State private var userName = ""
|
||||||
@State private var password = ""
|
@State private var password = ""
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ struct AddAccountDialog: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
Section(header: Text("Online banking login data")) {
|
Section(header: Text("Online banking login data")) {
|
||||||
LabelledUIKitTextField(label: "Online banking login name", text: $customerId, placeholder: "Enter Online banking login name",
|
LabelledUIKitTextField(label: "Online banking login name", text: $userName, placeholder: "Enter Online banking login name",
|
||||||
autocapitalizationType: .none, focusNextTextFieldOnReturnKeyPress: true, actionOnReturnKeyPress: handleReturnKeyPress)
|
autocapitalizationType: .none, focusNextTextFieldOnReturnKeyPress: true, actionOnReturnKeyPress: handleReturnKeyPress)
|
||||||
|
|
||||||
LabelledUIKitTextField(label: "Online banking login password", text: $password, placeholder: "Enter Online banking login password",
|
LabelledUIKitTextField(label: "Online banking login password", text: $password, placeholder: "Enter Online banking login password",
|
||||||
|
@ -76,7 +76,7 @@ struct AddAccountDialog: View {
|
||||||
|
|
||||||
func isRequiredDataEntered() -> Bool {
|
func isRequiredDataEntered() -> Bool {
|
||||||
return bank != nil
|
return bank != nil
|
||||||
&& customerId.isNotBlank
|
&& userName.isNotBlank
|
||||||
&& password.isNotBlank
|
&& password.isNotBlank
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ struct AddAccountDialog: View {
|
||||||
isTryingToAddAccount = true
|
isTryingToAddAccount = true
|
||||||
UIApplication.hideKeyboard()
|
UIApplication.hideKeyboard()
|
||||||
|
|
||||||
presenter.addAccountAsync(bankInfo: bank, customerId: customerId, password: password) { (response) in
|
presenter.addAccountAsync(bankInfo: bank, userName: userName, password: password) { (response) in
|
||||||
self.handleAddAccountResponse(response)
|
self.handleAddAccountResponse(response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ struct BankSettingsDialog: View {
|
||||||
|
|
||||||
@State private var displayName: String
|
@State private var displayName: String
|
||||||
|
|
||||||
@State private var customerId: String
|
@State private var userName: String
|
||||||
@State private var password: String
|
@State private var password: String
|
||||||
|
|
||||||
@State private var selectedTanMethod: TanMethod?
|
@State private var selectedTanMethod: TanMethod?
|
||||||
|
@ -26,7 +26,7 @@ struct BankSettingsDialog: View {
|
||||||
|
|
||||||
private var hasUnsavedData: Bool {
|
private var hasUnsavedData: Bool {
|
||||||
return bank.displayName != displayName
|
return bank.displayName != displayName
|
||||||
|| bank.customerId != customerId
|
|| bank.userName != userName
|
||||||
|| bank.password != password
|
|| bank.password != password
|
||||||
|| bank.selectedTanMethod != selectedTanMethod
|
|| bank.selectedTanMethod != selectedTanMethod
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ struct BankSettingsDialog: View {
|
||||||
|
|
||||||
_displayName = State(initialValue: bank.displayName)
|
_displayName = State(initialValue: bank.displayName)
|
||||||
|
|
||||||
_customerId = State(initialValue: bank.customerId)
|
_userName = State(initialValue: bank.userName)
|
||||||
_password = State(initialValue: bank.password)
|
_password = State(initialValue: bank.password)
|
||||||
|
|
||||||
_selectedTanMethod = State(initialValue: bank.selectedTanMethod)
|
_selectedTanMethod = State(initialValue: bank.selectedTanMethod)
|
||||||
|
@ -53,7 +53,7 @@ struct BankSettingsDialog: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
Section(header: Text("Credentials")) {
|
Section(header: Text("Credentials")) {
|
||||||
LabelledUIKitTextField(label: "Online banking login name", text: $customerId, autocapitalizationType: .none)
|
LabelledUIKitTextField(label: "Online banking login name", text: $userName, autocapitalizationType: .none)
|
||||||
|
|
||||||
LabelledUIKitTextField(label: "Online banking login password", text: $password, autocapitalizationType: .none, isPasswordField: true)
|
LabelledUIKitTextField(label: "Online banking login password", text: $password, autocapitalizationType: .none, isPasswordField: true)
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ struct BankSettingsDialog: View {
|
||||||
if hasUnsavedData {
|
if hasUnsavedData {
|
||||||
bank.userSetDisplayName = displayName
|
bank.userSetDisplayName = displayName
|
||||||
|
|
||||||
bank.customerId = customerId
|
bank.userName = userName
|
||||||
bank.password = password
|
bank.password = password
|
||||||
|
|
||||||
bank.selectedTanMethod = selectedTanMethod
|
bank.selectedTanMethod = selectedTanMethod
|
||||||
|
|
|
@ -215,14 +215,14 @@ struct EnterTanDialog: View {
|
||||||
|
|
||||||
struct EnterTanDialog_Previews: PreviewProvider {
|
struct EnterTanDialog_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
let customer = BankData(bankCode: "", customerId: "", password: "", finTsServerAddress: "")
|
let bank = BankData(bankCode: "", userName: "", password: "", finTsServerAddress: "")
|
||||||
customer.supportedTanMethods = previewTanMethods
|
bank.supportedTanMethods = previewTanMethods
|
||||||
|
|
||||||
customer.tanMedia = previewTanMedia
|
bank.tanMedia = previewTanMedia
|
||||||
|
|
||||||
let tanChallenge = previewTanChallenge
|
let tanChallenge = previewTanChallenge
|
||||||
|
|
||||||
let enterTanState = EnterTanState(customer, tanChallenge, { result in })
|
let enterTanState = EnterTanState(bank, tanChallenge, { result in })
|
||||||
|
|
||||||
return EnterTanDialog(enterTanState)
|
return EnterTanDialog(enterTanState)
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,7 +181,7 @@ open class fints4kBankingClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun mapToBankData(bank: TypedBankData): BankData {
|
protected open fun mapToBankData(bank: TypedBankData): BankData {
|
||||||
return BankData(bank.bankCode, bank.customerId, bank.password, bank.finTsServerAddress, bank.bic, bank.bankName)
|
return BankData(bank.bankCode, bank.userName, bank.password, bank.finTsServerAddress, bank.bic, bank.bankName)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun restoreData(bank: TypedBankData): BankData? {
|
protected open fun restoreData(bank: TypedBankData): BankData? {
|
||||||
|
@ -205,7 +205,7 @@ open class fints4kBankingClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun getFints4kClientDataFile(bank: TypedBankData): File {
|
protected open fun getFints4kClientDataFile(bank: TypedBankData): File {
|
||||||
return getFints4kClientDataFile(bank.bankCode, bank.customerId)
|
return getFints4kClientDataFile(bank.bankCode, bank.userName)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun getFints4kClientDataFile(bankCode: String, customerId: String): File {
|
protected open fun getFints4kClientDataFile(bankCode: String, customerId: String): File {
|
||||||
|
|
|
@ -71,7 +71,7 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
|
|
||||||
open fun mapBank(bank: TypedBankData, fintsBank: BankData) {
|
open fun mapBank(bank: TypedBankData, fintsBank: BankData) {
|
||||||
bank.bankCode = fintsBank.bankCode
|
bank.bankCode = fintsBank.bankCode
|
||||||
bank.customerId = fintsBank.customerId
|
bank.userName = fintsBank.customerId
|
||||||
bank.password = fintsBank.pin
|
bank.password = fintsBank.pin
|
||||||
bank.finTsServerAddress = fintsBank.finTs3ServerAddress
|
bank.finTsServerAddress = fintsBank.finTs3ServerAddress
|
||||||
bank.bankName = fintsBank.bankName
|
bank.bankName = fintsBank.bankName
|
||||||
|
@ -89,7 +89,7 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
* In UI only customerId, password, (bankCode,) and selected TAN method can be set
|
* In UI only customerId, password, (bankCode,) and selected TAN method can be set
|
||||||
*/
|
*/
|
||||||
open fun mapChangesFromUiToClientModel(bank: TypedBankData, fintsBank: BankData) {
|
open fun mapChangesFromUiToClientModel(bank: TypedBankData, fintsBank: BankData) {
|
||||||
fintsBank.customerId = bank.customerId
|
fintsBank.customerId = bank.userName
|
||||||
fintsBank.pin = bank.password
|
fintsBank.pin = bank.password
|
||||||
|
|
||||||
fintsBank.bankCode = bank.bankCode
|
fintsBank.bankCode = bank.bankCode
|
||||||
|
@ -116,7 +116,6 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
account.accountHolderName = accountData.accountHolderName
|
account.accountHolderName = accountData.accountHolderName
|
||||||
account.iban = accountData.iban
|
account.iban = accountData.iban
|
||||||
account.subAccountNumber = accountData.subAccountAttribute
|
account.subAccountNumber = accountData.subAccountAttribute
|
||||||
account.customerId = accountData.customerId
|
|
||||||
|
|
||||||
account.currency = accountData.currency ?: "EUR"
|
account.currency = accountData.currency ?: "EUR"
|
||||||
account.type = mapBankAccountType(accountData.accountType)
|
account.type = mapBankAccountType(accountData.accountType)
|
||||||
|
|
|
@ -273,12 +273,12 @@ open class hbci4jBankingClient(
|
||||||
|
|
||||||
|
|
||||||
override fun dataChanged(bank: TypedBankData) {
|
override fun dataChanged(bank: TypedBankData) {
|
||||||
if (bank.bankCode != credentials.bankCode || bank.customerId != credentials.customerId || bank.password != credentials.password) {
|
if (bank.bankCode != credentials.bankCode || bank.userName != credentials.customerId || bank.password != credentials.password) {
|
||||||
getPassportFile(credentials).delete()
|
getPassportFile(credentials).delete()
|
||||||
}
|
}
|
||||||
|
|
||||||
credentials.bankCode = bank.bankCode
|
credentials.bankCode = bank.bankCode
|
||||||
credentials.customerId = bank.customerId
|
credentials.customerId = bank.userName
|
||||||
credentials.password = bank.password
|
credentials.password = bank.password
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,6 @@ open class AccountCredentials(
|
||||||
var password: String
|
var password: String
|
||||||
) {
|
) {
|
||||||
|
|
||||||
constructor(bank: TypedBankData) : this(bank.bankCode, bank.customerId, bank.password)
|
constructor(bank: TypedBankData) : this(bank.bankCode, bank.userName, bank.password)
|
||||||
|
|
||||||
}
|
}
|
|
@ -51,7 +51,6 @@ open class hbci4jModelMapper(
|
||||||
|
|
||||||
result.iban = iban
|
result.iban = iban
|
||||||
result.subAccountNumber = account.subnumber
|
result.subAccountNumber = account.subnumber
|
||||||
result.customerId = account.customerid
|
|
||||||
|
|
||||||
result.currency = account.curr
|
result.currency = account.curr
|
||||||
result.type = mapBankAccountType(account)
|
result.type = mapBankAccountType(account)
|
||||||
|
|
Loading…
Reference in New Issue