From f053b2728d081b1e441d965287618ce97a554c97 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 4 Oct 2020 21:56:54 +0200 Subject: [PATCH] Using now English names for BankAccountTypes --- .../banking/persistence/model/BankAccount.kt | 6 +-- .../persistence/model/BankAccountEntity.kt | 2 +- .../dankito/banking/ui/model/BankAccount.kt | 6 +-- .../banking/ui/model/BankAccountType.kt | 20 +++++----- .../BankingiOSApp/persistence/Mapper.swift | 40 +++++++++---------- .../banking/mapper/fints4kModelMapper.kt | 20 +++++----- .../dankito/banking/util/hbci4jModelMapper.kt | 24 +++++------ 7 files changed, 58 insertions(+), 60 deletions(-) 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 216527ae..04687afa 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 @@ -20,7 +20,7 @@ open class BankAccount( override var subAccountNumber: String?, override var balance: BigDecimal = BigDecimal.Zero, override var currency: String = "EUR", - override var type: BankAccountType = BankAccountType.Girokonto, + override var type: BankAccountType = BankAccountType.CheckingAccount, override var productName: String? = null, override var accountLimit: String? = null, override var retrievedTransactionsFromOn: Date? = null, @@ -41,9 +41,9 @@ open class BankAccount( /* convenience constructors for languages not supporting default values */ - 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.CheckingAccount) - 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.CheckingAccount, balance: BigDecimal = BigDecimal.Zero) : this(bank, identifier, "", null, null, balance, "EUR", type, productName) 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 b8a2d0d6..f18bf7b9 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 @@ -18,7 +18,7 @@ open class BankAccountEntity( override var subAccountNumber: String?, override var balance: BigDecimal = BigDecimal.Zero, override var currency: String = "EUR", - override var type: BankAccountType = BankAccountType.Girokonto, + override var type: BankAccountType = BankAccountType.CheckingAccount, override var productName: String? = null, override var accountLimit: String? = null, override var retrievedTransactionsFromOn: Date? = null, 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 559b4e27..29ddd48f 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 @@ -14,7 +14,7 @@ open class BankAccount @JvmOverloads constructor( override var subAccountNumber: String?, override var balance: BigDecimal = BigDecimal.Zero, override var currency: String = "EUR", - override var type: BankAccountType = BankAccountType.Girokonto, + override var type: BankAccountType = BankAccountType.CheckingAccount, override var productName: String? = null, override var accountLimit: String? = null, override var retrievedTransactionsFromOn: Date? = null, @@ -31,9 +31,9 @@ open class BankAccount @JvmOverloads constructor( /* convenience constructors for languages not supporting default values */ - 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.CheckingAccount) - 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.CheckingAccount, balance: BigDecimal = BigDecimal.Zero) : this(bank, identifier, "", null, null, balance, "EUR", type, productName) diff --git a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccountType.kt b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccountType.kt index 963cffc1..1457eef9 100644 --- a/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccountType.kt +++ b/ui/BankingUiCommon/src/commonMain/kotlin/net/dankito/banking/ui/model/BankAccountType.kt @@ -3,24 +3,24 @@ package net.dankito.banking.ui.model enum class BankAccountType { - Girokonto, + CheckingAccount, - Sparkonto, + SavingsAccount, - Festgeldkonto, + FixedTermDepositAccount, - Wertpapierdepot, + SecuritiesAccount, - Darlehenskonto, + LoanAccount, - Kreditkartenkonto, + CreditCardAccount, - FondsDepot, + FundDeposit, - Bausparvertrag, + BuildingLoanContract, - Versicherungsvertrag, + InsuranceContract, - Sonstige + Other } \ No newline at end of file diff --git a/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift b/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift index 878d0a7e..8c8a7abf 100644 --- a/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift +++ b/ui/BankingiOSApp/BankingiOSApp/persistence/Mapper.swift @@ -126,28 +126,26 @@ class Mapper { func map(_ type: String?) -> BankAccountType { switch type { - case BankAccountType.girokonto.name: - return BankAccountType.girokonto - case BankAccountType.sparkonto.name: - return BankAccountType.sparkonto - case BankAccountType.festgeldkonto.name: - return BankAccountType.festgeldkonto - case BankAccountType.wertpapierdepot.name: - return BankAccountType.wertpapierdepot - case BankAccountType.darlehenskonto.name: - return BankAccountType.darlehenskonto - case BankAccountType.kreditkartenkonto.name: - return BankAccountType.kreditkartenkonto - case BankAccountType.fondsdepot.name: - return BankAccountType.fondsdepot - case BankAccountType.bausparvertrag.name: - return BankAccountType.bausparvertrag - case BankAccountType.versicherungsvertrag.name: - return BankAccountType.versicherungsvertrag - case BankAccountType.sonstige.name: - return BankAccountType.sonstige + case BankAccountType.checkingaccount.name: + return .checkingaccount + case BankAccountType.savingsaccount.name: + return .savingsaccount + case BankAccountType.fixedtermdepositaccount.name: + return .fixedtermdepositaccount + case BankAccountType.securitiesaccount.name: + return .securitiesaccount + case BankAccountType.loanaccount.name: + return .loanaccount + case BankAccountType.creditcardaccount.name: + return .creditcardaccount + case BankAccountType.funddeposit.name: + return .funddeposit + case BankAccountType.buildingloancontract.name: + return .buildingloancontract + case BankAccountType.insurancecontract.name: + return .insurancecontract default: - return BankAccountType.girokonto + return .other } } 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 0e68c79a..18cb0211 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 @@ -131,16 +131,16 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) { open fun mapBankAccountType(type: AccountType?): BankAccountType { return when (type) { - AccountType.Girokonto -> BankAccountType.Girokonto - AccountType.Sparkonto -> BankAccountType.Sparkonto - AccountType.Festgeldkonto -> BankAccountType.Festgeldkonto - AccountType.Wertpapierdepot -> BankAccountType.Wertpapierdepot - AccountType.Darlehenskonto -> BankAccountType.Darlehenskonto - AccountType.Kreditkartenkonto -> BankAccountType.Kreditkartenkonto - AccountType.FondsDepot -> BankAccountType.FondsDepot - AccountType.Bausparvertrag -> BankAccountType.Bausparvertrag - AccountType.Versicherungsvertrag -> BankAccountType.Versicherungsvertrag - else -> BankAccountType.Sonstige + AccountType.Girokonto -> BankAccountType.CheckingAccount + AccountType.Sparkonto -> BankAccountType.SavingsAccount + AccountType.Festgeldkonto -> BankAccountType.FixedTermDepositAccount + AccountType.Wertpapierdepot -> BankAccountType.SecuritiesAccount + AccountType.Darlehenskonto -> BankAccountType.LoanAccount + AccountType.Kreditkartenkonto -> BankAccountType.CreditCardAccount + AccountType.FondsDepot -> BankAccountType.FundDeposit + AccountType.Bausparvertrag -> BankAccountType.BuildingLoanContract + AccountType.Versicherungsvertrag -> BankAccountType.InsuranceContract + else -> BankAccountType.Other } } 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 ce9feaa7..9b089f13 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 @@ -54,7 +54,7 @@ open class hbci4jModelMapper( result.currency = account.curr result.type = mapBankAccountType(account) - result.isAccountTypeSupportedByApplication = result.type == BankAccountType.Girokonto || result.type == BankAccountType.Festgeldkonto + result.isAccountTypeSupportedByApplication = result.type == BankAccountType.CheckingAccount || result.type == BankAccountType.FixedTermDepositAccount result.accountLimit = account.limit?.value?.let { mapValue(it).toString() } result.supportsRetrievingBalance = account.allowedGVs.contains("HKSAL") @@ -69,17 +69,17 @@ open class hbci4jModelMapper( val type = account.acctype return when { - type.length == 1 -> BankAccountType.Girokonto - type.startsWith("1") -> BankAccountType.Sparkonto - type.startsWith("2") -> BankAccountType.Festgeldkonto - type.startsWith("3") -> BankAccountType.Wertpapierdepot - type.startsWith("4") -> BankAccountType.Darlehenskonto - type.startsWith("5") -> BankAccountType.Kreditkartenkonto - type.startsWith("6") -> BankAccountType.FondsDepot - type.startsWith("7") -> BankAccountType.Bausparvertrag - type.startsWith("8") -> BankAccountType.Versicherungsvertrag - type.startsWith("9") -> BankAccountType.Sonstige - else -> BankAccountType.Sonstige + type.length == 1 -> BankAccountType.CheckingAccount + type.startsWith("1") -> BankAccountType.SavingsAccount + type.startsWith("2") -> BankAccountType.FixedTermDepositAccount + type.startsWith("3") -> BankAccountType.SecuritiesAccount + type.startsWith("4") -> BankAccountType.LoanAccount + type.startsWith("5") -> BankAccountType.CreditCardAccount + type.startsWith("6") -> BankAccountType.FundDeposit + type.startsWith("7") -> BankAccountType.BuildingLoanContract + type.startsWith("8") -> BankAccountType.InsuranceContract + type.startsWith("9") -> BankAccountType.Other + else -> BankAccountType.Other } }