summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2022-09-23 16:35:47 +0200
committerMS <ms@taler.net>2022-09-23 16:35:47 +0200
commitdcc4a11c162b34f47eddedd1c6d28b1b4376403e (patch)
tree955f639782ab089e24b850dc22f75e4ce18913b8
parent41862b566fab33a9702edfbff873769d801c6e03 (diff)
downloadlibeufin-dcc4a11c162b34f47eddedd1c6d28b1b4376403e.tar.gz
libeufin-dcc4a11c162b34f47eddedd1c6d28b1b4376403e.tar.bz2
libeufin-dcc4a11c162b34f47eddedd1c6d28b1b4376403e.zip
close Zip file + DCE
-rw-r--r--sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt41
-rw-r--r--util/src/main/kotlin/zip.kt1
2 files changed, 1 insertions, 41 deletions
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
index 873371d0..2175ab0d 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/bankAccount.kt
@@ -55,45 +55,4 @@ fun balanceForAccount(bankAccount: BankAccountEntity): BigDecimal {
}
}
return balance
-}
-
-// For now, returns everything.
-fun historyForAccount(bankAccount: BankAccountEntity): MutableList<RawPayment> {
- val history = mutableListOf<RawPayment>()
- transaction {
- /**
- FIXME: add the following condition too:
- and (BankAccountTransactionsTable.date.between(start.millis, end.millis))
- */
- /**
- FIXME: add the following condition too:
- and (BankAccountTransactionsTable.date.between(start.millis, end.millis))
- */
- BankAccountTransactionEntity.find {
- BankAccountTransactionsTable.account eq bankAccount.id
- }.forEach {
- history.add(
- RawPayment(
- subject = it.subject,
- creditorIban = it.creditorIban,
- creditorBic = it.creditorBic,
- creditorName = it.creditorName,
- debtorIban = it.debtorIban,
- debtorBic = it.debtorBic,
- debtorName = it.debtorName,
- date = importDateFromMillis(it.date).toDashedDate(),
- amount = it.amount,
- currency = it.currency,
- // The line below produces a value too long (>35 chars),
- // and it makes the document invalid!
- // uid = "${it.pmtInfId}-${it.msgId}"
- uid = it.accountServicerReference,
- direction = it.direction,
- pmtInfId = it.pmtInfId
- )
- )
-
- }
- }
- return history
} \ No newline at end of file
diff --git a/util/src/main/kotlin/zip.kt b/util/src/main/kotlin/zip.kt
index e22571b3..3f6f94a9 100644
--- a/util/src/main/kotlin/zip.kt
+++ b/util/src/main/kotlin/zip.kt
@@ -66,4 +66,5 @@ fun ByteArray.unzipWithLambda(process: (Pair<String, String>) -> Unit) {
Pair(it.name, zipFile.getInputStream(it).readAllBytes().toString(Charsets.UTF_8))
)
}
+ zipFile.close()
} \ No newline at end of file