Using now English names for BankAccountTypes
This commit is contained in:
parent
bc180f68ab
commit
f053b2728d
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue