commit e2a0842bf0d845dcb3201920bed2ed0fdd0e7322
parent 3118c928e7543907c49720f55fa84dd70c32be7a
Author: MS <ms@taler.net>
Date: Sat, 18 Nov 2023 08:07:25 +0100
nexus db
setting as nullable the values that are not always found
in CaMt documents for outgoing transactions. Notably, the
camt.054 Lastschriftavisierung lacks payee IBAN and name,
and payment subject.
Diffstat:
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/database-versioning/libeufin-nexus-0001.sql b/database-versioning/libeufin-nexus-0001.sql
@@ -64,7 +64,7 @@ CREATE TABLE IF NOT EXISTS outgoing_transactions
,amount taler_amount NOT NULL
,wire_transfer_subject TEXT
,execution_time INT8 NOT NULL
- ,credit_payto_uri TEXT NOT NULL
+ ,credit_payto_uri TEXT
,bank_transfer_id TEXT NOT NULL
);
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Database.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Database.kt
@@ -92,12 +92,15 @@ enum class PaymentInitiationOutcome {
// OUTGOING PAYMENTS STRUCTS
+/**
+ * Collects data of a booked outgoing payment.
+ */
data class OutgoingPayment(
val amount: TalerAmount,
- val wireTransferSubject: String,
val executionTime: Instant,
- val creditPaytoUri: String,
- val bankTransferId: String
+ val bankTransferId: String,
+ val creditPaytoUri: String? = null, // not showing in camt.054
+ val wireTransferSubject: String? = null // not showing in camt.054
)
/**
@@ -183,8 +186,8 @@ class Database(dbConfig: String): java.io.Closeable {
*
* @param paymentData information about the outgoing payment.
* @param reconcileId optional row ID of the initiated payment
- * that will reference this one. Note: if this value is
- * not found, then NO row gets inserted in the database.
+ * that will reference this one. If null, then only the
+ * outgoing payment record gets inserted.
* @return operation outcome enum.
*/
suspend fun outgoingPaymentCreate(