Renamed transactionsRetentionDays to serverTransactionsRetentionDays
This commit is contained in:
parent
288af22ac6
commit
376cb08a9f
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue