commit 91e6a43917622a91e1c6f69bfbf155ec63d87073
parent 71d67b8834e9b886f139d8ff35f43433bceec0df
Author: MS <ms@taler.net>
Date: Fri, 1 Sep 2023 13:54:23 +0200
Bank DB: getting the history query to return.
Diffstat:
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Database.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Database.kt
@@ -329,7 +329,7 @@ class Database(private val dbConfig: String) {
,debtor_bic
,debtor_name
,subject
- ,(amount).val AS amount_val,
+ ,(amount).val AS amount_val
,(amount).frac AS amount_frac
,transaction_date
,account_servicer_reference
@@ -338,7 +338,7 @@ class Database(private val dbConfig: String) {
,direction
,bank_account_id
FROM bank_account_transactions
- WHERE bank_account_transaction_id < ?
+ WHERE bank_transaction_id < ?
AND bank_account_id=?
AND transaction_date BETWEEN ? AND ?
""")
diff --git a/sandbox/src/test/kotlin/DatabaseTest.kt b/sandbox/src/test/kotlin/DatabaseTest.kt
@@ -203,4 +203,16 @@ class DatabaseTest {
// Finally confirming the operation (means customer wired funds to the exchange.)
assert(db.talerWithdrawalGet(uuid)?.confirmationDone == true)
}
+ // Only testing the interaction between Kotlin and the DBMS. No actual logic tested.
+ @Test
+ fun historyTest() {
+ val db = initDb()
+ val res = db.bankTransactionGetForHistoryPage(
+ 10L,
+ 1L,
+ fromMs = 0,
+ toMs = Long.MAX_VALUE
+ )
+ assert(res.isEmpty())
+ }
}
\ No newline at end of file