diff options
author | MS <ms@taler.net> | 2023-09-01 13:54:23 +0200 |
---|---|---|
committer | MS <ms@taler.net> | 2023-09-01 13:54:23 +0200 |
commit | 91e6a43917622a91e1c6f69bfbf155ec63d87073 (patch) | |
tree | c8a2fa34b46a9c58fcd593abf602d8558871bf69 | |
parent | 71d67b8834e9b886f139d8ff35f43433bceec0df (diff) | |
download | libeufin-91e6a43917622a91e1c6f69bfbf155ec63d87073.tar.gz libeufin-91e6a43917622a91e1c6f69bfbf155ec63d87073.tar.bz2 libeufin-91e6a43917622a91e1c6f69bfbf155ec63d87073.zip |
Bank DB: getting the history query to return.
-rw-r--r-- | sandbox/src/main/kotlin/tech/libeufin/sandbox/Database.kt | 4 | ||||
-rw-r--r-- | sandbox/src/test/kotlin/DatabaseTest.kt | 12 |
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 index eab8d7f0..dde9d47b 100644 --- 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 index ff4f537b..2ca6aeb3 100644 --- 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 |