commit dcc4a11c162b34f47eddedd1c6d28b1b4376403e
parent 41862b566fab33a9702edfbff873769d801c6e03
Author: MS <ms@taler.net>
Date: Fri, 23 Sep 2022 16:35:47 +0200
close Zip file + DCE
Diffstat:
2 files changed, 1 insertion(+), 41 deletions(-)
diff --git 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
@@ -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