diff --git a/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionRepository.kt b/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionRepository.kt index 0746ec2..b808cae 100644 --- a/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionRepository.kt +++ b/src/main/kotlin/com/wbrawner/budgetserver/transaction/TransactionRepository.kt @@ -13,7 +13,7 @@ interface TransactionRepository: PagingAndSortingRepository { fun findAllByAccountAndCategory(account: Account, category: Category): List @Query( nativeQuery = true, - value = "SELECT (COALESCE((SELECT SUM(amount) from transaction WHERE is_expense = 0), 0)) - (COALESCE((SELECT SUM(amount) from transaction WHERE is_expense = 1), 0));" + value = "SELECT (COALESCE((SELECT SUM(amount) from transaction WHERE expense = 0), 0)) - (COALESCE((SELECT SUM(amount) from transaction WHERE expense = 1), 0));" ) fun sumBalanceByAccount(account: Account): Long } \ No newline at end of file