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 ->