From 8969a7f2d263e77302960e36e15d04bf8588b11d Mon Sep 17 00:00:00 2001 From: William Brawner Date: Mon, 6 Dec 2021 21:41:44 -0700 Subject: [PATCH] Fix recurring transactions query --- .../com/wbrawner/twigs/db/JdbcRecurringTransactionRepository.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/src/main/kotlin/com/wbrawner/twigs/db/JdbcRecurringTransactionRepository.kt b/db/src/main/kotlin/com/wbrawner/twigs/db/JdbcRecurringTransactionRepository.kt index ba4c647..7b21b0d 100644 --- a/db/src/main/kotlin/com/wbrawner/twigs/db/JdbcRecurringTransactionRepository.kt +++ b/db/src/main/kotlin/com/wbrawner/twigs/db/JdbcRecurringTransactionRepository.kt @@ -15,7 +15,7 @@ class JdbcRecurringTransactionRepository(dataSource: DataSource) : override val conflictFields: Collection = listOf(ID) override suspend fun findAll(now: Instant): List = dataSource.connection.use { conn -> - conn.executeQuery("SELECT * FROM $tableName WHERE ${Fields.START.name.lowercase()} < ? AND ${Fields.FINISH.name.lowercase()} > ?", listOf(now, now)) + conn.executeQuery("SELECT * FROM $tableName WHERE ${Fields.START.name.lowercase()} < ? AND (${Fields.FINISH.name.lowercase()} IS NULL OR ${Fields.FINISH.name.lowercase()} > ?)", listOf(now, now)) } override suspend fun findAll(budgetId: String): List = dataSource.connection.use { conn ->