gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated (219bc3cc -> f8c9db87)


From: gnunet
Subject: [libeufin] branch master updated (219bc3cc -> f8c9db87)
Date: Wed, 02 Aug 2023 12:51:30 +0200

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

ms pushed a change to branch master
in repository libeufin.

    from 219bc3cc Server side EBICS date range.
     new 4130342d commenting the SQL
     new f8c9db87 Time-framed query.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 database-versioning/new/nexus-0001-refactor.sql      | 20 ++++++++++++++++++++
 .../nexus/xlibeufinbank/XLibeufinBankNexus.kt        |  4 ++--
 util/src/main/kotlin/time.kt                         |  5 +++++
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/database-versioning/new/nexus-0001-refactor.sql 
b/database-versioning/new/nexus-0001-refactor.sql
index e63cf753..9df5877e 100644
--- a/database-versioning/new/nexus-0001-refactor.sql
+++ b/database-versioning/new/nexus-0001-refactor.sql
@@ -9,6 +9,8 @@ SET search_path TO nexus;
 
 -- start of: user management
 
+-- This table accounts the users registered at Nexus
+-- without any mention of banking connections.
 CREATE TABLE IF NOT EXISTS nexus_users
   (id BIGSERIAL PRIMARY KEY
   ,username TEXT NOT NULL
@@ -20,6 +22,10 @@ CREATE TABLE IF NOT EXISTS nexus_users
 
 -- start of: connection management
 
+
+-- This table accounts the bank connections that were
+-- created in Nexus and points to their owners.  NO connection
+-- configuration details are supposed to exist here.
 CREATE TABLE IF NOT EXISTS nexus_bank_connections 
   (id BIGSERIAL PRIMARY KEY
   ,connection_id TEXT NOT NULL
@@ -29,6 +35,10 @@ CREATE TABLE IF NOT EXISTS nexus_bank_connections
   ,CONSTRAINT fk_nexusbankconnections_user_id FOREIGN KEY (user) REFERENCES 
nexus_users(id) ON DELETE RESTRICT ON UPDATE RESTRICT
   );
 
+
+-- Details of one EBICS connection.  Each row should point to
+-- nexus_bank_connections, where the meta information (like name and type)
+-- about the connection is stored.
 CREATE TABLE IF NOT EXISTS nexus_ebics_subscribers
   (id BIGSERIAL PRIMARY KEY
   ,ebics_url TEXT NOT NULL
@@ -47,6 +57,9 @@ CREATE TABLE IF NOT EXISTS nexus_ebics_subscribers
   ,CONSTRAINT fk_nexusebicssubscribers_nexusbankconnection_id FOREIGN KEY 
(nexus_bank_connection) REFERENCES nexus_bank_connections(id) ON DELETE 
RESTRICT ON UPDATE RESTRICT
   );
 
+
+-- Details of one X-LIBEUFIN-BANK connection.  In other
+-- words, each line is one Libeufin-Sandbox user.
 CREATE TABLE IF NOT EXISTS xlibeufin_bank_users
   (id BIGSERIAL PRIMARY KEY
   ,username TEXT NOT NULL
@@ -56,6 +69,13 @@ CREATE TABLE IF NOT EXISTS xlibeufin_bank_users
   ,CONSTRAINT fk_xlibeufinbankusers_nexusbankconnection_id FOREIGN KEY 
(nexus_bank_connection) REFERENCES nexus_bank_connections(id) ON DELETE 
RESTRICT ON UPDATE RESTRICT
   );
 
+
+-- This table holds the names of the bank accounts as they
+-- exist at the bank where the Nexus user has one account.
+-- This table participates in the process of 'importing' one
+-- bank account.  The importing action has the main goal of
+-- providing friendlier names to the Nexus side of one bank
+-- account.
 CREATE TABLE IF NOT EXISTS offered_bank_accounts 
   (id BIGSERIAL PRIMARY KEY
   ,offered_account_id TEXT NOT NULL
diff --git 
a/nexus/src/main/kotlin/tech/libeufin/nexus/xlibeufinbank/XLibeufinBankNexus.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/xlibeufinbank/XLibeufinBankNexus.kt
index b6f025bf..6fbc8ca6 100644
--- 
a/nexus/src/main/kotlin/tech/libeufin/nexus/xlibeufinbank/XLibeufinBankNexus.kt
+++ 
b/nexus/src/main/kotlin/tech/libeufin/nexus/xlibeufinbank/XLibeufinBankNexus.kt
@@ -268,8 +268,8 @@ class XlibeufinBankConnectionProtocol : 
BankConnectionProtocol {
                     // the parse() method defaults to the YYYY-MM-DD format.
                     val start: LocalDate = LocalDate.parse(fetchSpec.start)
                     val end: LocalDate = LocalDate.parse(fetchSpec.end)
-                    this.parameters["from_ms"] = start.toString()
-                    this.parameters["to_ms"] = end.toString()
+                    this.parameters["from_ms"] = start.millis().toString()
+                    this.parameters["to_ms"] = end.millis().toString()
                 }
                 // Gets the last 5 transactions
                 is FetchSpecLatestJson -> {
diff --git a/util/src/main/kotlin/time.kt b/util/src/main/kotlin/time.kt
index 867d1950..13394537 100644
--- a/util/src/main/kotlin/time.kt
+++ b/util/src/main/kotlin/time.kt
@@ -54,6 +54,11 @@ fun LocalDateTime.millis(): Long {
     return instant.toEpochMilli()
 }
 
+fun LocalDate.millis(): Long {
+    val instant = Instant.from(this)
+    return instant.toEpochMilli()
+}
+
 fun parseDashedDate(maybeDashedDate: String?): LocalDate {
     if (maybeDashedDate == null)
         throw badRequest("dashed date found as null")

-- 
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]