Implemented specifying detaily if a bank, an account or only display index got updated
This commit is contained in:
parent
0ea9fad7a0
commit
b7d94e8a17
|
@ -253,7 +253,7 @@ open class BankingPresenter(
|
||||||
for (i in IntRange(displayIndex, sortedBanks.size - 1)) {
|
for (i in IntRange(displayIndex, sortedBanks.size - 1)) {
|
||||||
val bank = sortedBanks[i]
|
val bank = sortedBanks[i]
|
||||||
bank.displayIndex = i
|
bank.displayIndex = i
|
||||||
accountUpdated(bank)
|
accountDisplayIndexUpdated(bank)
|
||||||
}
|
}
|
||||||
|
|
||||||
callAccountsChangedListeners()
|
callAccountsChangedListeners()
|
||||||
|
@ -384,14 +384,22 @@ open class BankingPresenter(
|
||||||
|
|
||||||
open fun allAccountsUpdated() {
|
open fun allAccountsUpdated() {
|
||||||
customers.forEach { account ->
|
customers.forEach { account ->
|
||||||
accountUpdated(account)
|
accountDisplayIndexUpdated(account)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun accountUpdated(account: Customer) {
|
open fun accountDisplayIndexUpdated(account: Customer) {
|
||||||
persistAccount(account)
|
persistAccount(account)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open fun accountUpdated(bank: Customer) {
|
||||||
|
persistAccount(bank)
|
||||||
|
}
|
||||||
|
|
||||||
|
open fun accountUpdated(account: BankAccount) {
|
||||||
|
persistAccount(account.customer)
|
||||||
|
}
|
||||||
|
|
||||||
protected open fun persistAccount(customer: Customer) {
|
protected open fun persistAccount(customer: Customer) {
|
||||||
persister.saveOrUpdateAccount(customer, customers)
|
persister.saveOrUpdateAccount(customer, customers)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue