diff --git a/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/Bank.kt b/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/Bank.kt index 64450f35..09212676 100644 --- a/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/Bank.kt +++ b/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/Bank.kt @@ -13,14 +13,14 @@ import net.dankito.banking.ui.model.tan.TanMethod @Entity open class Bank( override var bankCode: String, - override var customerId: String, + override var userName: String, override var password: String, override var finTsServerAddress: String, override var bankName: String, override var bic: String, override var customerName: String, - override var userId: String = customerId, + override var userId: String = userName, override var iconUrl: String? = null, @Ignore diff --git a/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/BankAccount.kt b/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/BankAccount.kt index 1da2eb78..0a4e8943 100644 --- a/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/BankAccount.kt +++ b/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/BankAccount.kt @@ -18,7 +18,6 @@ open class BankAccount( override var accountHolderName: String, override var iban: String?, override var subAccountNumber: String?, - override var customerId: String, override var balance: BigDecimal = BigDecimal.Zero, override var currency: String = "EUR", 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, 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) diff --git a/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/RoomModelCreator.kt b/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/RoomModelCreator.kt index d74e1999..0e64b0c7 100644 --- a/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/RoomModelCreator.kt +++ b/persistence/database/RoomBankingPersistence/src/main/java/net/dankito/banking/persistence/model/RoomModelCreator.kt @@ -12,10 +12,10 @@ import net.dankito.utils.multiplatform.Date 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 { - 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 { diff --git a/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/mapper/EntitiesModelCreator.kt b/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/mapper/EntitiesModelCreator.kt index ad2f5e0a..8004f098 100644 --- a/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/mapper/EntitiesModelCreator.kt +++ b/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/mapper/EntitiesModelCreator.kt @@ -13,15 +13,15 @@ import net.dankito.utils.multiplatform.Date 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 { - 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 { - 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( diff --git a/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankAccountEntity.kt b/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankAccountEntity.kt index ad0fd0c8..062e5c63 100644 --- a/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankAccountEntity.kt +++ b/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankAccountEntity.kt @@ -16,7 +16,6 @@ open class BankAccountEntity( override var accountHolderName: String, override var iban: String?, override var subAccountNumber: String?, - override var customerId: String, override var balance: BigDecimal = BigDecimal.Zero, override var currency: String = "EUR", override var type: BankAccountType = BankAccountType.Girokonto, @@ -38,7 +37,7 @@ open class BankAccountEntity( ) : IBankAccount { - internal constructor() : this(BankDataEntity(), "", "", null, null, "") // for object deserializers + internal constructor() : this(BankDataEntity(), "", "", null, null) // for object deserializers override fun toString(): String { diff --git a/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankDataEntity.kt b/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankDataEntity.kt index f78ac077..781ba18f 100644 --- a/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankDataEntity.kt +++ b/persistence/json/BankingPersistenceJson/src/main/kotlin/net/dankito/banking/persistence/model/BankDataEntity.kt @@ -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) open class BankDataEntity( override var bankCode: String, - override var customerId: String, + override var userName: String, override var password: String, override var finTsServerAddress: String, override var bankName: String, override var bic: String, override var customerName: String, - override var userId: String = customerId, + override var userId: String = userName, override var iconUrl: String? = null, override var accounts: List = listOf(), override var supportedTanMethods: List = listOf(), diff --git a/persistence/json/BankingPersistenceJson/src/test/kotlin/net/dankito/banking/persistence/BankingPersistenceJsonTest.kt b/persistence/json/BankingPersistenceJson/src/test/kotlin/net/dankito/banking/persistence/BankingPersistenceJsonTest.kt index 609a5daf..72a1be6c 100644 --- a/persistence/json/BankingPersistenceJson/src/test/kotlin/net/dankito/banking/persistence/BankingPersistenceJsonTest.kt +++ b/persistence/json/BankingPersistenceJson/src/test/kotlin/net/dankito/banking/persistence/BankingPersistenceJsonTest.kt @@ -132,8 +132,8 @@ class BankingPersistenceJsonTest { } private fun createAccount(productName: String, customer: BankDataEntity, countTransactions: Int = 0): BankAccountEntity { - val result = BankAccountEntity(customer, customer.customerId, "AccountHolder", "DE00" + customer.bankCode + customer.customerId, null, - customer.customerId, BigDecimal(84.25), productName = productName) + val result = BankAccountEntity(customer, customer.userName, "AccountHolder", "DE00" + customer.bankCode + customer.userName, null, + BigDecimal(84.25), productName = productName) result.bookedTransactions = createTransactions(countTransactions, result) @@ -172,7 +172,7 @@ class BankingPersistenceJsonTest { private fun assertBanksEqual(deserializedBank: BankDataEntity, bank: BankDataEntity) { 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.finTsServerAddress).isEqualTo(bank.finTsServerAddress) @@ -206,7 +206,6 @@ class BankingPersistenceJsonTest { assertThat(deserializedAccount.identifier).isEqualTo(account.identifier) assertThat(deserializedAccount.iban).isEqualTo(account.iban) - assertThat(deserializedAccount.customerId).isEqualTo(account.customerId) assertThat(deserializedAccount.balance).isEqualTo(account.balance) assertThat(deserializedAccount.productName).isEqualTo(account.productName) diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt index 9b3f1e3c..e9a86000 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/AddAccountDialog.kt @@ -69,11 +69,11 @@ open class AddAccountDialog : DialogFragment() { rootView.apply { initBankListAutocompletion(edtxtBank.actualEditText) - edtxtCustomerId.actualEditText.addTextChangedListener(otherEditTextChangedWatcher) + edtxtUserName.actualEditText.addTextChangedListener(otherEditTextChangedWatcher) edtxtPassword.actualEditText.addTextChangedListener(otherEditTextChangedWatcher) addAccountIfEnterPressed(edtxtBank.actualEditText) - addAccountIfEnterPressed(edtxtCustomerId.actualEditText) + addAccountIfEnterPressed(edtxtUserName.actualEditText) addAccountIfEnterPressed(edtxtPassword.actualEditText) btnAddAccount.setOnClickListener { addAccount() } @@ -111,13 +111,13 @@ open class AddAccountDialog : DialogFragment() { protected open fun addAccount() { selectedBank?.let { selectedBank -> // should always be non-null at this stage - val customerId = edtxtCustomerId.text + val userName = edtxtUserName.text val password = edtxtPassword.text btnAddAccount.isEnabled = false pgrbrAddAccount.visibility = View.VISIBLE - presenter.addAccountAsync(selectedBank, customerId, password) { response -> + presenter.addAccountAsync(selectedBank, userName, password) { response -> context?.asActivity()?.runOnUiThread { btnAddAccount.isEnabled = true pgrbrAddAccount.visibility = View.GONE @@ -160,7 +160,7 @@ open class AddAccountDialog : DialogFragment() { edtxtBank.text = bank.name - edtxtCustomerId.requestFocus() + edtxtUserName.requestFocus() checkIfRequiredDataEnteredOnUiThread() @@ -183,7 +183,7 @@ open class AddAccountDialog : DialogFragment() { protected open fun checkIfRequiredDataEnteredOnUiThread() { val requiredDataEntered = selectedBank != null && selectedBank?.supportsFinTs3_0 == true - && edtxtCustomerId.text.isNotEmpty() + && edtxtUserName.text.isNotEmpty() && edtxtPassword.text.isNotEmpty() btnAddAccount.isEnabled = requiredDataEntered diff --git a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/BankSettingsDialog.kt b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/BankSettingsDialog.kt index 4e047aa2..1c232bb9 100644 --- a/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/BankSettingsDialog.kt +++ b/ui/BankingAndroidApp/src/main/java/net/dankito/banking/ui/android/dialogs/settings/BankSettingsDialog.kt @@ -5,7 +5,7 @@ import android.view.* import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.DialogFragment 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.view.* import net.dankito.banking.ui.android.R @@ -68,7 +68,7 @@ open class BankSettingsDialog : DialogFragment() { } edtxtBankName.text = bank.displayName - edtxtCustomerId.text = bank.customerId + edtxtUserName.text = bank.userName edtxtPassword.text = bank.password btnDeleteAccount.setOnClickListener { askUserToDeleteAccount() } @@ -86,7 +86,7 @@ open class BankSettingsDialog : DialogFragment() { protected val hasUnsavedChanges: Boolean get() = didChange(edtxtBankName, bank.displayName) - || didChange(edtxtCustomerId, bank.customerId) + || didChange(edtxtUserName, bank.userName) || didChange(edtxtPassword, bank.password) protected open fun didChange(editedValue: FormEditText, originalValue: String): Boolean { @@ -105,7 +105,7 @@ open class BankSettingsDialog : DialogFragment() { protected open fun saveChanges() { bank.userSetDisplayName = edtxtBankName.text - bank.customerId = edtxtCustomerId.text + bank.userName = edtxtUserName.text bank.password = edtxtPassword.text presenter.bankUpdated(bank) diff --git a/ui/BankingAndroidApp/src/main/res/layout/dialog_add_account.xml b/ui/BankingAndroidApp/src/main/res/layout/dialog_add_account.xml index 5d268483..4b2db192 100644 --- a/ui/BankingAndroidApp/src/main/res/layout/dialog_add_account.xml +++ b/ui/BankingAndroidApp/src/main/res/layout/dialog_add_account.xml @@ -24,7 +24,7 @@ - searchBanks(newValue) } - customerId.addListener { _, _, _ -> checkIfRequiredDataHasBeenEntered() } + userName.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"] prefHeight = TextFieldHeight @@ -234,7 +234,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window( protected open fun checkIfRequiredDataHasBeenEntered() { requiredDataHasBeenEntered.value = selectedBank != null && 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? } @@ -243,7 +243,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window( isEnteredCredentialsResultVisible.value = false selectedBank?.let { - presenter.addAccountAsync(it, customerId.value, password.value) { response -> + presenter.addAccountAsync(it, userName.value, password.value) { response -> runLater { handleAddAccountResultOnUiThread(response) } } } @@ -259,7 +259,7 @@ open class AddAccountDialog(protected val presenter: BankingPresenter) : Window( val account = response.bank 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 } diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt index 8b6f4291..d4810ae0 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccount.kt @@ -12,7 +12,6 @@ open class BankAccount @JvmOverloads constructor( override var accountHolderName: String, override var iban: String?, override var subAccountNumber: String?, - override var customerId: String, override var balance: BigDecimal = BigDecimal.Zero, override var currency: String = "EUR", 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, 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() diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankData.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankData.kt index 7b8459d3..2f81c659 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankData.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankData.kt @@ -7,13 +7,13 @@ import net.dankito.utils.multiplatform.UUID open class BankData( override var bankCode: String, - override var customerId: String, + override var userName: String, override var password: String, override var finTsServerAddress: String, override var bankName: String, override var bic: String, override var customerName: String, - override var userId: String = customerId, + override var userId: String = userName, override var iconUrl: String? = null, override var accounts: List = listOf() ) : TypedBankData { @@ -23,8 +23,8 @@ open class BankData( /* convenience constructors for languages not supporting default values */ - constructor(bankCode: String, customerId: String, password: String, finTsServerAddress: String) - : this(bankCode, customerId, password, finTsServerAddress, "", "", "") + constructor(bankCode: String, userName: String, password: String, finTsServerAddress: String) + : this(bankCode, userName, password, finTsServerAddress, "", "", "") override var technicalId: String = UUID.random() diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankAccount.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankAccount.kt index 0d824b0c..91835245 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankAccount.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankAccount.kt @@ -13,7 +13,6 @@ interface IBankAccount : OrderedDisplayable { var accountHolderName: String var iban: String? var subAccountNumber: String? - var customerId: String var balance: BigDecimal var currency: String var type: BankAccountType diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankData.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankData.kt index 27f1d13d..c9f0eff1 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankData.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/IBankData.kt @@ -14,7 +14,7 @@ typealias TypedBankData = IBankData, IAccountT interface IBankData, TAccountTransaction: IAccountTransaction> : OrderedDisplayable { var bankCode: String - var customerId: String + var userName: String var password: String var finTsServerAddress: String @@ -58,6 +58,6 @@ interface IBankData, TAccountTransac val stringRepresentation: String - get() = "$bankName $customerId" + get() = "$bankName $userName" } \ No newline at end of file diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/mapper/DefaultModelCreator.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/mapper/DefaultModelCreator.kt index d2e173aa..7f9c9602 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/mapper/DefaultModelCreator.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/mapper/DefaultModelCreator.kt @@ -7,10 +7,10 @@ import net.dankito.utils.multiplatform.Date 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 { - return BankData(bankCode, customerId, password, finTsServerAddress, bankName, bic, customerName, userId, iconUrl) + return BankData(bankCode, userName, password, finTsServerAddress, bankName, bic, customerName, userId, iconUrl) } diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/mapper/IModelCreator.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/mapper/IModelCreator.kt index 2e86cba9..58252e1d 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/mapper/IModelCreator.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/mapper/IModelCreator.kt @@ -8,8 +8,8 @@ import net.dankito.utils.multiplatform.Date interface IModelCreator { - fun createBank(bankCode: String, customerId: String, password: String, finTsServerAddress: String, bankName: String, bic: String, - customerName: String = "", userId: String = customerId, iconUrl: String? = null): TypedBankData + fun createBank(bankCode: String, userName: String, password: String, finTsServerAddress: String, bankName: String, bic: String, + customerName: String = "", userId: String = userName, iconUrl: String? = null): TypedBankData fun createAccount(bank: TypedBankData, productName: String?, identifier: String) : TypedBankAccount diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt index 5d3325ff..3ca36063 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -146,8 +146,8 @@ open class BankingPresenter( // TODO: move BankInfo out of fints4k - open fun addAccountAsync(bankInfo: BankInfo, customerId: String, password: String, callback: (AddAccountResponse) -> Unit) { - val bank = modelCreator.createBank(bankInfo.bankCode, customerId, password, bankInfo.pinTanAddress ?: "", bankInfo.name, bankInfo.bic, "") + open fun addAccountAsync(bankInfo: BankInfo, userName: String, password: String, callback: (AddAccountResponse) -> Unit) { + val bank = modelCreator.createBank(bankInfo.bankCode, userName, password, bankInfo.pinTanAddress ?: "", bankInfo.name, bankInfo.bic, "") val newClient = bankingClientCreator.createClient(bank, dataFolder, asyncRunner, this.callback) @@ -259,7 +259,7 @@ open class BankingPresenter( 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() diff --git a/ui/BankingiOSApp/BankingiOSApp/BankingiOSApp.xcdatamodeld/BankingiOSApp.xcdatamodel/contents b/ui/BankingiOSApp/BankingiOSApp/BankingiOSApp.xcdatamodeld/BankingiOSApp.xcdatamodel/contents index a9a0dcfb..74991583 100644 --- a/ui/BankingiOSApp/BankingiOSApp/BankingiOSApp.xcdatamodeld/BankingiOSApp.xcdatamodel/contents +++ b/ui/BankingiOSApp/BankingiOSApp/BankingiOSApp.xcdatamodeld/BankingiOSApp.xcdatamodel/contents @@ -41,12 +41,11 @@ - - + - + @@ -65,7 +64,6 @@ - @@ -73,6 +71,7 @@ + @@ -91,7 +90,7 @@ - + diff --git a/ui/BankingiOSApp/BankingiOSApp/Preview Content/PreviewData.swift b/ui/BankingiOSApp/BankingiOSApp/Preview Content/PreviewData.swift index 446cfcb2..3229d3bf 100644 --- a/ui/BankingiOSApp/BankingiOSApp/Preview Content/PreviewData.swift +++ b/ui/BankingiOSApp/BankingiOSApp/Preview Content/PreviewData.swift @@ -16,7 +16,7 @@ let previewFlickerCodeTanChallenge = FlickerCodeTanChallenge(flickerCode: Flicke 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 = [ 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 = [ BankAccount(bank: bank2, productName: "Girokonto", identifier: "1234567890") diff --git a/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift b/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift index 77ac3b92..11540080 100644 --- a/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift +++ b/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift @@ -6,7 +6,7 @@ import BankingUiSwift class Mapper { 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) @@ -29,7 +29,7 @@ class Mapper { let mapped = context.objectByID(bank.technicalId) ?? PersistedBankData(context: context) mapped.bankCode = bank.bankCode - mapped.customerId = bank.customerId + mapped.userName = bank.userName mapped.password = bank.password mapped.finTsServerAddress = bank.finTsServerAddress mapped.bankName = bank.bankName @@ -58,7 +58,7 @@ class Mapper { } 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.isAccountTypeSupportedByApplication = account.isAccountTypeSupportedByApplication @@ -85,7 +85,6 @@ class Mapper { mapped.accountHolderName = account.accountHolderName mapped.iban = account.iban mapped.subAccountNumber = account.subAccountNumber - mapped.customerId = account.customerId mapped.balance = account.balance.decimal mapped.currency = account.currency mapped.type = map(account.type) diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AddAccountDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AddAccountDialog.swift index 6f2d3be7..c5055b50 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AddAccountDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AddAccountDialog.swift @@ -7,7 +7,7 @@ struct AddAccountDialog: View { @State private var bank: BankInfo? = nil - @State private var customerId = "" + @State private var userName = "" @State private var password = "" @@ -38,7 +38,7 @@ struct AddAccountDialog: View { } 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) LabelledUIKitTextField(label: "Online banking login password", text: $password, placeholder: "Enter Online banking login password", @@ -76,7 +76,7 @@ struct AddAccountDialog: View { func isRequiredDataEntered() -> Bool { return bank != nil - && customerId.isNotBlank + && userName.isNotBlank && password.isNotBlank } @@ -85,7 +85,7 @@ struct AddAccountDialog: View { isTryingToAddAccount = true 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) } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/BankSettingsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/BankSettingsDialog.swift index 8b556281..1fe6f3cb 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/BankSettingsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/BankSettingsDialog.swift @@ -14,7 +14,7 @@ struct BankSettingsDialog: View { @State private var displayName: String - @State private var customerId: String + @State private var userName: String @State private var password: String @State private var selectedTanMethod: TanMethod? @@ -26,7 +26,7 @@ struct BankSettingsDialog: View { private var hasUnsavedData: Bool { return bank.displayName != displayName - || bank.customerId != customerId + || bank.userName != userName || bank.password != password || bank.selectedTanMethod != selectedTanMethod } @@ -37,7 +37,7 @@ struct BankSettingsDialog: View { _displayName = State(initialValue: bank.displayName) - _customerId = State(initialValue: bank.customerId) + _userName = State(initialValue: bank.userName) _password = State(initialValue: bank.password) _selectedTanMethod = State(initialValue: bank.selectedTanMethod) @@ -53,7 +53,7 @@ struct BankSettingsDialog: View { } 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) } @@ -130,7 +130,7 @@ struct BankSettingsDialog: View { if hasUnsavedData { bank.userSetDisplayName = displayName - bank.customerId = customerId + bank.userName = userName bank.password = password bank.selectedTanMethod = selectedTanMethod diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/EnterTanDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/EnterTanDialog.swift index c0a20bfa..cce0be3b 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/EnterTanDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/EnterTanDialog.swift @@ -215,14 +215,14 @@ struct EnterTanDialog: View { struct EnterTanDialog_Previews: PreviewProvider { static var previews: some View { - let customer = BankData(bankCode: "", customerId: "", password: "", finTsServerAddress: "") - customer.supportedTanMethods = previewTanMethods + let bank = BankData(bankCode: "", userName: "", password: "", finTsServerAddress: "") + bank.supportedTanMethods = previewTanMethods - customer.tanMedia = previewTanMedia + bank.tanMedia = previewTanMedia let tanChallenge = previewTanChallenge - let enterTanState = EnterTanState(customer, tanChallenge, { result in }) + let enterTanState = EnterTanState(bank, tanChallenge, { result in }) return EnterTanDialog(enterTanState) } diff --git a/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/fints4kBankingClient.kt b/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/fints4kBankingClient.kt index 4f8d059e..5f6af5f8 100644 --- a/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/fints4kBankingClient.kt +++ b/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/fints4kBankingClient.kt @@ -181,7 +181,7 @@ open class fints4kBankingClient( } 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? { @@ -205,7 +205,7 @@ open class fints4kBankingClient( } 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 { diff --git a/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt b/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt index 0a0bff25..86aa7f2b 100644 --- a/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt +++ b/ui/fints4kBankingClient/src/commonMain/kotlin/net/dankito/banking/mapper/fints4kModelMapper.kt @@ -71,7 +71,7 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) { open fun mapBank(bank: TypedBankData, fintsBank: BankData) { bank.bankCode = fintsBank.bankCode - bank.customerId = fintsBank.customerId + bank.userName = fintsBank.customerId bank.password = fintsBank.pin bank.finTsServerAddress = fintsBank.finTs3ServerAddress 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 */ open fun mapChangesFromUiToClientModel(bank: TypedBankData, fintsBank: BankData) { - fintsBank.customerId = bank.customerId + fintsBank.customerId = bank.userName fintsBank.pin = bank.password fintsBank.bankCode = bank.bankCode @@ -116,7 +116,6 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) { account.accountHolderName = accountData.accountHolderName account.iban = accountData.iban account.subAccountNumber = accountData.subAccountAttribute - account.customerId = accountData.customerId account.currency = accountData.currency ?: "EUR" account.type = mapBankAccountType(accountData.accountType) diff --git a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt index 32082009..43d6fe7e 100644 --- a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt +++ b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/hbci4jBankingClient.kt @@ -273,12 +273,12 @@ open class hbci4jBankingClient( 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() } credentials.bankCode = bank.bankCode - credentials.customerId = bank.customerId + credentials.customerId = bank.userName credentials.password = bank.password } diff --git a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/model/AccountCredentials.kt b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/model/AccountCredentials.kt index 44d4d0ff..5883a536 100644 --- a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/model/AccountCredentials.kt +++ b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/model/AccountCredentials.kt @@ -9,6 +9,6 @@ open class AccountCredentials( var password: String ) { - constructor(bank: TypedBankData) : this(bank.bankCode, bank.customerId, bank.password) + constructor(bank: TypedBankData) : this(bank.bankCode, bank.userName, bank.password) } \ No newline at end of file diff --git a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/util/hbci4jModelMapper.kt b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/util/hbci4jModelMapper.kt index 2f22ad55..ce9feaa7 100644 --- a/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/util/hbci4jModelMapper.kt +++ b/ui/hbci4jBankingClient/src/main/kotlin/net/dankito/banking/util/hbci4jModelMapper.kt @@ -51,7 +51,6 @@ open class hbci4jModelMapper( result.iban = iban result.subAccountNumber = account.subnumber - result.customerId = account.customerid result.currency = account.curr result.type = mapBankAccountType(account)