diff options
author | Antoine A <> | 2024-05-07 18:26:55 +0900 |
---|---|---|
committer | Antoine A <> | 2024-05-07 18:26:55 +0900 |
commit | dd7e83cb00544273ccd794030ccf785dfa516c49 (patch) | |
tree | 8c9ee00ef3624c9902df815d2e98cd575db7d2be /nexus/src/main | |
parent | 7243876ab11582fed2ae21eedb2a2807a2c19318 (diff) | |
download | libeufin-dd7e83cb00544273ccd794030ccf785dfa516c49.tar.gz libeufin-dd7e83cb00544273ccd794030ccf785dfa516c49.tar.bz2 libeufin-dd7e83cb00544273ccd794030ccf785dfa516c49.zip |
Improve list cmd
Diffstat (limited to 'nexus/src/main')
-rw-r--r-- | nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 6 | ||||
-rw-r--r-- | nexus/src/main/kotlin/tech/libeufin/nexus/db/PaymentDAO.kt | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt index 1ae3bdb3..f93b1829 100644 --- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt +++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -358,14 +358,16 @@ class ListCmd: CliktCommand("List nexus transactions", name = "list") { val txs = db.payment.metadataOutgoing() Pair( listOf( - "transaction", "id", "creditor", "subject" + "transaction", "id", "creditor", "wtid", "exchange URL", "subject" ), txs.map { listOf( "${it.date} ${it.amount}", it.id, fmtPayto(it.creditor), - it.subject ?: "" + it.wtid?.toString() ?: "", + it.exchangeBaseUrl ?: "", + it.subject ?: "", ) } ) diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/db/PaymentDAO.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/db/PaymentDAO.kt index e17184eb..a07857cf 100644 --- a/nexus/src/main/kotlin/tech/libeufin/nexus/db/PaymentDAO.kt +++ b/nexus/src/main/kotlin/tech/libeufin/nexus/db/PaymentDAO.kt @@ -225,7 +225,10 @@ class PaymentDAO(private val db: Database) { ,execution_time ,credit_payto_uri ,message_id + ,wtid + ,exchange_base_url FROM outgoing_transactions + LEFT OUTER JOIN talerable_outgoing_transactions using (outgoing_transaction_id) ORDER BY execution_time """) stmt.all { @@ -234,7 +237,9 @@ class PaymentDAO(private val db: Database) { amount = it.getDecimal("amount"), subject = it.getString("wire_transfer_subject"), creditor = it.getString("credit_payto_uri"), - id = it.getString("message_id") + id = it.getString("message_id"), + wtid = it.getBytes("wtid")?.run { ShortHashCode(this) }, + exchangeBaseUrl = it.getString("exchange_base_url") ) } } @@ -289,7 +294,8 @@ data class OutgoingTxMetadata( val subject: String?, val creditor: String?, val id: String, - // TODO when merged with v11 + val wtid: ShortHashCode?, + val exchangeBaseUrl: String? ) /** Initiated metadata for debugging */ |