Made all properties overridable
This commit is contained in:
parent
f36237ebcc
commit
0e194faee7
|
@ -1,14 +1,11 @@
|
||||||
package net.dankito.banking.ui.model
|
package net.dankito.banking.ui.model
|
||||||
|
|
||||||
//import com.fasterxml.jackson.annotation.JsonIdentityInfo
|
|
||||||
//import com.fasterxml.jackson.annotation.ObjectIdGenerators
|
|
||||||
import net.dankito.utils.multiplatform.BigDecimal
|
import net.dankito.utils.multiplatform.BigDecimal
|
||||||
import net.dankito.utils.multiplatform.Date
|
import net.dankito.utils.multiplatform.Date
|
||||||
import net.dankito.utils.multiplatform.UUID
|
import net.dankito.utils.multiplatform.UUID
|
||||||
import kotlin.jvm.JvmOverloads
|
import kotlin.jvm.JvmOverloads
|
||||||
|
|
||||||
|
|
||||||
//@JsonIdentityInfo(property = "id", generator = ObjectIdGenerators.PropertyGenerator::class) // to avoid stack overflow due to circular references
|
|
||||||
open class BankAccount @JvmOverloads constructor(
|
open class BankAccount @JvmOverloads constructor(
|
||||||
open val customer: Customer,
|
open val customer: Customer,
|
||||||
open val identifier: String,
|
open val identifier: String,
|
||||||
|
@ -26,7 +23,8 @@ open class BankAccount @JvmOverloads constructor(
|
||||||
open var supportsRetrievingBalance: Boolean = false,
|
open var supportsRetrievingBalance: Boolean = false,
|
||||||
open var supportsTransferringMoney: Boolean = false,
|
open var supportsTransferringMoney: Boolean = false,
|
||||||
open var supportsInstantPaymentMoneyTransfer: Boolean = false,
|
open var supportsInstantPaymentMoneyTransfer: Boolean = false,
|
||||||
bookedAccountTransactions: List<AccountTransaction> = listOf()
|
open var bookedTransactions: List<AccountTransaction> = listOf(),
|
||||||
|
open var unbookedTransactions: List<Any> = listOf()
|
||||||
) {
|
) {
|
||||||
|
|
||||||
internal constructor() : this(Customer(), null, "") // for object deserializers
|
internal constructor() : this(Customer(), null, "") // for object deserializers
|
||||||
|
@ -58,13 +56,6 @@ open class BankAccount @JvmOverloads constructor(
|
||||||
get() = "${customer.bankName} ${displayName}"
|
get() = "${customer.bankName} ${displayName}"
|
||||||
|
|
||||||
|
|
||||||
open var bookedTransactions: List<AccountTransaction> = bookedAccountTransactions
|
|
||||||
protected set
|
|
||||||
|
|
||||||
open var unbookedTransactions: List<Any> = listOf()
|
|
||||||
protected set
|
|
||||||
|
|
||||||
|
|
||||||
open fun addBookedTransactions(retrievedBookedTransactions: List<AccountTransaction>) {
|
open fun addBookedTransactions(retrievedBookedTransactions: List<AccountTransaction>) {
|
||||||
val uniqueTransactions = this.bookedTransactions.toMutableSet()
|
val uniqueTransactions = this.bookedTransactions.toMutableSet()
|
||||||
|
|
||||||
|
|
|
@ -3,25 +3,25 @@ package net.dankito.banking.ui.model
|
||||||
//import com.fasterxml.jackson.annotation.JsonIdentityInfo
|
//import com.fasterxml.jackson.annotation.JsonIdentityInfo
|
||||||
//import com.fasterxml.jackson.annotation.ObjectIdGenerators
|
//import com.fasterxml.jackson.annotation.ObjectIdGenerators
|
||||||
import net.dankito.utils.multiplatform.BigDecimal
|
import net.dankito.utils.multiplatform.BigDecimal
|
||||||
import net.dankito.utils.multiplatform.UUID
|
|
||||||
import net.dankito.utils.multiplatform.sum
|
import net.dankito.utils.multiplatform.sum
|
||||||
import net.dankito.banking.ui.model.tan.TanMedium
|
import net.dankito.banking.ui.model.tan.TanMedium
|
||||||
import net.dankito.banking.ui.model.tan.TanMediumStatus
|
import net.dankito.banking.ui.model.tan.TanMediumStatus
|
||||||
import net.dankito.banking.ui.model.tan.TanProcedure
|
import net.dankito.banking.ui.model.tan.TanProcedure
|
||||||
|
import net.dankito.utils.multiplatform.UUID
|
||||||
|
|
||||||
|
|
||||||
//@JsonIdentityInfo(property = "id", generator = ObjectIdGenerators.PropertyGenerator::class) // to avoid stack overflow due to circular references
|
//@JsonIdentityInfo(property = "id", generator = ObjectIdGenerators.PropertyGenerator::class) // to avoid stack overflow due to circular references
|
||||||
open class Customer(
|
open class Customer(
|
||||||
val bankCode: String,
|
open val bankCode: String,
|
||||||
val customerId: String,
|
open val customerId: String,
|
||||||
var password: String,
|
open var password: String,
|
||||||
var finTsServerAddress: String,
|
open var finTsServerAddress: String,
|
||||||
var bankName: String,
|
open var bankName: String,
|
||||||
var bic: String,
|
open var bic: String,
|
||||||
var customerName: String,
|
open var customerName: String,
|
||||||
var userId: String = customerId,
|
open var userId: String = customerId,
|
||||||
var iconUrl: String? = null,
|
open var iconUrl: String? = null,
|
||||||
var accounts: List<BankAccount> = listOf()
|
open var accounts: List<BankAccount> = listOf()
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,26 +33,26 @@ open class Customer(
|
||||||
: this(bankCode, customerId, password, finTsServerAddress, "", "", "")
|
: this(bankCode, customerId, password, finTsServerAddress, "", "", "")
|
||||||
|
|
||||||
|
|
||||||
var id: String = UUID.random()
|
open var id: String = UUID.random()
|
||||||
|
|
||||||
|
|
||||||
var supportedTanProcedures: List<TanProcedure> = listOf()
|
open var supportedTanProcedures: List<TanProcedure> = listOf()
|
||||||
|
|
||||||
var selectedTanProcedure: TanProcedure? = null
|
open var selectedTanProcedure: TanProcedure? = null
|
||||||
|
|
||||||
var tanMedia: List<TanMedium> = listOf()
|
open var tanMedia: List<TanMedium> = listOf()
|
||||||
|
|
||||||
val tanMediaSorted: List<TanMedium>
|
open val tanMediaSorted: List<TanMedium>
|
||||||
get() = tanMedia.sortedByDescending { it.status == TanMediumStatus.Used }
|
get() = tanMedia.sortedByDescending { it.status == TanMediumStatus.Used }
|
||||||
|
|
||||||
|
|
||||||
val displayName: String
|
open val displayName: String
|
||||||
get() = bankName
|
get() = bankName
|
||||||
|
|
||||||
val balance: BigDecimal
|
open val balance: BigDecimal
|
||||||
get() = accounts.map { it.balance }.sum()
|
get() = accounts.map { it.balance }.sum()
|
||||||
|
|
||||||
val transactions: List<AccountTransaction>
|
open val transactions: List<AccountTransaction>
|
||||||
get() = accounts.flatMap { it.bookedTransactions }
|
get() = accounts.flatMap { it.bookedTransactions }
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue