gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: store balance only when it changes


From: gnunet
Subject: [libeufin] branch master updated: store balance only when it changes
Date: Wed, 20 Jul 2022 18:01:20 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new e9513cdd store balance only when it changes
e9513cdd is described below

commit e9513cdd2c98b8329b31df4c50aa0efd84c0cf63
Author: MS <ms@taler.net>
AuthorDate: Wed Jul 20 14:14:06 2022 +0200

    store balance only when it changes
---
 .../kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git 
a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
index c0e20dc3..ebd0c91e 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/bankaccount/BankAccount.kt
@@ -172,11 +172,14 @@ fun processCamtMessage(
                 var clbdCount = 0
                 if (b.type == "CLBD") {
                     clbdCount++
-                    NexusBankBalanceEntity.new {
-                        bankAccount = acct
-                        balance = b.amount.toPlainString()
-                        creditDebitIndicator = b.creditDebitIndicator.name
-                        date = b.date
+                    val lastBalance = NexusBankBalanceEntity.all().lastOrNull()
+                    if (lastBalance != null && b.amount.toPlainString() != 
lastBalance.balance) {
+                        NexusBankBalanceEntity.new {
+                            bankAccount = acct
+                            balance = b.amount.toPlainString()
+                            creditDebitIndicator = b.creditDebitIndicator.name
+                            date = b.date
+                        }
                     }
                 }
                 if (clbdCount == 0) {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]