summaryrefslogtreecommitdiff
path: root/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt')
-rw-r--r--sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt9
1 files changed, 5 insertions, 4 deletions
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
index 8fe70541..5d492914 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Helpers.kt
@@ -215,8 +215,8 @@ fun getOrderTypeFromTransactionId(transactionID: String): String {
return uploadTransaction.orderType
}
-fun getHistoryElementFromTransactionRow(dbRow: BankAccountTransactionEntity): RawPayment {
- return RawPayment(
+fun getHistoryElementFromTransactionRow(dbRow: BankAccountTransactionEntity): XLibeufinBankTransaction {
+ return XLibeufinBankTransaction(
subject = dbRow.subject,
creditorIban = dbRow.creditorIban,
creditorBic = dbRow.creditorBic,
@@ -231,7 +231,8 @@ fun getHistoryElementFromTransactionRow(dbRow: BankAccountTransactionEntity): Ra
// and dbRow makes the document invalid!
// uid = "${dbRow.pmtInfId}-${it.msgId}"
uid = dbRow.accountServicerReference,
- direction = dbRow.direction,
+ // Eventually, the _database_ should contain the direction enum:
+ direction = XLibeufinBankDirection.convertCamtDirectionToXLibeufin(dbRow.direction),
pmtInfId = dbRow.pmtInfId
)
}
@@ -256,7 +257,7 @@ fun printConfig(demobank: DemobankConfigEntity) {
fun getHistoryElementFromTransactionRow(
dbRow: BankAccountFreshTransactionEntity
-): RawPayment {
+): XLibeufinBankTransaction {
return getHistoryElementFromTransactionRow(dbRow.transactionRef)
}