Renamed transactionsRetentionDays to serverTransactionsRetentionDays

This commit is contained in:
dankito 2024-09-08 21:55:31 +02:00
parent 288af22ac6
commit 376cb08a9f
1 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ open class BankAccount(
// var balance: BigDecimal = BigDecimal.ZERO, // var balance: BigDecimal = BigDecimal.ZERO,
var balance: Amount = Amount.Zero, // TODO: add a BigDecimal library var balance: Amount = Amount.Zero, // TODO: add a BigDecimal library
val transactionsRetentionDays: Int? = null, val serverTransactionsRetentionDays: Int? = null,
open var lastTransactionsRetrievalTime: Instant? = null, open var lastTransactionsRetrievalTime: Instant? = null,
var retrievedTransactionsFrom: LocalDate? = null, var retrievedTransactionsFrom: LocalDate? = null,
@ -61,7 +61,7 @@ open class BankAccount(
/** /**
* Determines if all transactions that are retained on bank server have been fetched. * Determines if all transactions that are retained on bank server have been fetched.
* *
* Does this by comparing [transactionsRetentionDays] to [retrievedTransactionsFrom]. * Does this by comparing [serverTransactionsRetentionDays] to [retrievedTransactionsFrom].
*/ */
open val haveAllRetainedTransactionsBeenRetrieved: Boolean by lazy { open val haveAllRetainedTransactionsBeenRetrieved: Boolean by lazy {
val fromDay = retrievedTransactionsFrom val fromDay = retrievedTransactionsFrom
@ -69,7 +69,7 @@ open class BankAccount(
false false
} else { } else {
// if countDaysForWhichTransactionsAreKeptOnBankServer is not set, we cannot know for how long bank server keeps transactions. We then assume for 90 days // if countDaysForWhichTransactionsAreKeptOnBankServer is not set, we cannot know for how long bank server keeps transactions. We then assume for 90 days
val storageDays = transactionsRetentionDays ?: 90 val storageDays = serverTransactionsRetentionDays ?: 90
fromDay < Clock.System.now().toLocalDateTime(TimeZone.of("Europe/Berlin")).date.minus(storageDays, DateTimeUnit.DAY) fromDay < Clock.System.now().toLocalDateTime(TimeZone.of("Europe/Berlin")).date.minus(storageDays, DateTimeUnit.DAY)
} }
} }