Added convenience constructors for languages not supporting default values
This commit is contained in:
parent
427b47a324
commit
3ed323cd69
|
@ -54,6 +54,16 @@ open class AccountTransaction(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// for object deserializers
|
||||||
|
internal constructor() : this(BankAccount(), null, "", BigDecimal.Zero, Date(), null)
|
||||||
|
|
||||||
|
/* convenience constructors for languages not supporting default values */
|
||||||
|
|
||||||
|
constructor(bankAccount: BankAccount, otherPartyName: String?, unparsedUsage: String, amount: BigDecimal, valueDate: Date, bookingText: String?)
|
||||||
|
: this(bankAccount, amount, "EUR", unparsedUsage, valueDate,
|
||||||
|
otherPartyName, null, null, bookingText, valueDate)
|
||||||
|
|
||||||
|
|
||||||
constructor(bankAccount: BankAccount, amount: BigDecimal, currency: String, unparsedUsage: String, bookingDate: Date,
|
constructor(bankAccount: BankAccount, amount: BigDecimal, currency: String, unparsedUsage: String, bookingDate: Date,
|
||||||
otherPartyName: String?, otherPartyBankCode: String?, otherPartyAccountId: String?,
|
otherPartyName: String?, otherPartyBankCode: String?, otherPartyAccountId: String?,
|
||||||
bookingText: String?, valueDate: Date)
|
bookingText: String?, valueDate: Date)
|
||||||
|
@ -61,10 +71,7 @@ open class AccountTransaction(
|
||||||
otherPartyName, otherPartyBankCode, otherPartyAccountId, bookingText, valueDate,
|
otherPartyName, otherPartyBankCode, otherPartyAccountId, bookingText, valueDate,
|
||||||
0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "", "", null, null, "", null)
|
0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "", "", null, null, "", null)
|
||||||
|
|
||||||
// for object deserializers
|
|
||||||
internal constructor() : this(BankAccount(), BigDecimal.Zero, "","", Date(), null, null, null, null, Date(), 0, null, BigDecimal.Zero, BigDecimal.Zero,
|
|
||||||
null, null, null, null, null, null, null, null, null, null, null, null, null,
|
|
||||||
null, "", "", null, null, "", null)
|
|
||||||
|
|
||||||
open var id: String = "${bankAccount.id} ${IdDateFormat.format(bookingDate)} ${IdDateFormat.format(valueDate)} $amount $currency $unparsedUsage $otherPartyName $otherPartyBankCode $otherPartyAccountId"
|
open var id: String = "${bankAccount.id} ${IdDateFormat.format(bookingDate)} ${IdDateFormat.format(valueDate)} $amount $currency $unparsedUsage $otherPartyName $otherPartyBankCode $otherPartyAccountId"
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,14 @@ open class BankAccount @JvmOverloads constructor(
|
||||||
bookedAccountTransactions: List<AccountTransaction> = listOf()
|
bookedAccountTransactions: List<AccountTransaction> = listOf()
|
||||||
) {
|
) {
|
||||||
|
|
||||||
internal constructor() : this(Customer(), "", "", null, null, "") // for object deserializers
|
internal constructor() : this(Customer(), null, "") // for object deserializers
|
||||||
|
|
||||||
|
/* convenience constructors for languages not supporting default values */
|
||||||
|
|
||||||
|
constructor(customer: Customer, productName: String?, identifier: String) : this(customer, productName, identifier, BankAccountType.Girokonto)
|
||||||
|
|
||||||
|
constructor(customer: Customer, productName: String?, identifier: String, type: BankAccountType = BankAccountType.Girokonto, balance: BigDecimal = BigDecimal.Zero)
|
||||||
|
: this(customer, identifier, "", null, null, "", balance, "EUR", type, productName)
|
||||||
|
|
||||||
|
|
||||||
open var id: String = UUID.random()
|
open var id: String = UUID.random()
|
||||||
|
|
|
@ -27,6 +27,11 @@ open class Customer(
|
||||||
|
|
||||||
internal constructor() : this("", "", "", "", "", "", "") // for object deserializers
|
internal constructor() : this("", "", "", "", "", "", "") // for object deserializers
|
||||||
|
|
||||||
|
/* convenience constructors for languages not supporting default values */
|
||||||
|
|
||||||
|
constructor(bankCode: String, customerId: String, password: String, finTsServerAddress: String)
|
||||||
|
: this(bankCode, customerId, password, finTsServerAddress, "", "", "")
|
||||||
|
|
||||||
|
|
||||||
var id: String = UUID.random()
|
var id: String = UUID.random()
|
||||||
|
|
||||||
|
|
|
@ -5,18 +5,19 @@ import BankingUiSwift
|
||||||
let previewBanks = createPreviewBanks()
|
let previewBanks = createPreviewBanks()
|
||||||
|
|
||||||
func createPreviewBanks() -> [BUCCustomer] {
|
func createPreviewBanks() -> [BUCCustomer] {
|
||||||
let bank1 = BUCCustomer(bankCode: "", customerId: "", password: "", finTsServerAddress: "", bankName: "Abzockbank", bic: "", customerName: "", userId: "", iconUrl: "", accounts: [])
|
let bank1 = BUCCustomer(bankCode: "", customerId: "", password: "", finTsServerAddress: "", bankName: "Abzockbank", bic: "", customerName: "Marieke Musterfrau", userId: "", iconUrl: "", accounts: [])
|
||||||
|
|
||||||
bank1.accounts = [
|
bank1.accounts = [
|
||||||
BUCBankAccount(customer: bank1, identifier: "id", accountHolderName: "Marieke Musterfrau", iban: nil, subAccountNumber: nil, customerId: "", balance: CommonBigDecimal(double: 17.0), currency: "EUR", type: .girokonto, productName: "Girokonto", accountLimit: nil, lastRetrievedTransactionsTimestamp: nil, supportsRetrievingAccountTransactions: true, supportsRetrievingBalance: true, supportsTransferringMoney: true, supportsInstantPaymentMoneyTransfer: true, bookedAccountTransactions: []),
|
BUCBankAccount(customer: bank1, productName: "Girokonto", identifier: "1234567890"),
|
||||||
|
|
||||||
BUCBankAccount(customer: bank1, identifier: "id", accountHolderName: "Marieke Musterfrau", iban: nil, subAccountNumber: nil, customerId: "", balance: CommonBigDecimal(double: 17.0), currency: "EUR", type: .festgeldkonto, productName: "Tagesgeld Minus", accountLimit: nil, lastRetrievedTransactionsTimestamp: nil, supportsRetrievingAccountTransactions: true, supportsRetrievingBalance: true, supportsTransferringMoney: true, supportsInstantPaymentMoneyTransfer: true, bookedAccountTransactions: [])
|
BUCBankAccount(customer: bank1, productName: "Tagesgeld Minus", identifier: "0987654321")
|
||||||
]
|
]
|
||||||
|
|
||||||
let bank2 = BUCCustomer(bankCode: "", customerId: "", password: "", finTsServerAddress: "", bankName: "Kundenverarschebank", bic: "", customerName: "", userId: "", iconUrl: "", accounts: [])
|
|
||||||
|
let bank2 = BUCCustomer(bankCode: "", customerId: "", password: "", finTsServerAddress: "", bankName: "Kundenverarschebank", bic: "", customerName: "Marieke Musterfrau", userId: "", iconUrl: "", accounts: [])
|
||||||
|
|
||||||
bank2.accounts = [
|
bank2.accounts = [
|
||||||
BUCBankAccount(customer: bank1, identifier: "id", accountHolderName: "Marieke Musterfrau", iban: nil, subAccountNumber: nil, customerId: "", balance: CommonBigDecimal(double: 17.0), currency: "EUR", type: .girokonto, productName: "Girokonto", accountLimit: nil, lastRetrievedTransactionsTimestamp: nil, supportsRetrievingAccountTransactions: true, supportsRetrievingBalance: true, supportsTransferringMoney: true, supportsInstantPaymentMoneyTransfer: true, bookedAccountTransactions: [])
|
BUCBankAccount(customer: bank2, productName: "Girokonto", identifier: "1234567890")
|
||||||
]
|
]
|
||||||
|
|
||||||
return [ bank1, bank2 ]
|
return [ bank1, bank2 ]
|
||||||
|
|
Loading…
Reference in New Issue