gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: facade config table


From: gnunet
Subject: [libeufin] branch master updated: facade config table
Date: Thu, 28 May 2020 15:17:57 +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 92c99c4  facade config table
92c99c4 is described below

commit 92c99c46046a58982aa9c874e2f9af6e70037f65
Author: MS <ms@taler.net>
AuthorDate: Thu May 28 15:17:44 2020 +0200

    facade config table
---
 nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt    | 18 +++++++++++++++++-
 nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt  |  9 ++++++++-
 nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt |  6 +++---
 3 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
index 916fea0..b53c7b0 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/DB.kt
@@ -280,7 +280,7 @@ object FacadesTable : IdTable<String>() {
     val bankAccountsWrite = text("bankAccountsWrite")
     val bankConnectionsRead = text("bankConnectionsRead")
     val bankConnectionsWrite = text("bankConnectionsWrite")
-    val config = blob("config").nullable() /* what's the best format to store 
Any? */
+    val config = reference("config", TalerFacadeConfigsTable)
 }
 
 class FacadeEntity(id: EntityID<String>) : Entity<String>(id) {
@@ -295,6 +295,22 @@ class FacadeEntity(id: EntityID<String>) : 
Entity<String>(id) {
     var config by FacadesTable.config
 }
 
+object TalerFacadeConfigsTable : IntIdTable() {
+    val bankAccount = text("bankAccount")
+    val bankConnection = text("bankConnection")
+    /* "statement", "report", "notification" */
+    val reserveTransferLevel = text("reserveTransferLevel")
+    val intervalIncrement = text("intervalIncrement")
+}
+
+class TalerFacadeConfigEntity(id: EntityID<Int>) : IntEntity(id) {
+    companion object : 
IntEntityClass<TalerFacadeConfigEntity>(TalerFacadeConfigsTable)
+    var bankAccount by TalerFacadeConfigsTable.bankAccount
+    var bankConnection by TalerFacadeConfigsTable.bankConnection
+    /* "statement", "report", "notification" */
+    var reserveTransferLevel by TalerFacadeConfigsTable.reserveTransferLevel
+    var intervalIncrement by TalerFacadeConfigsTable.intervalIncrement
+}
 
 fun dbCreateTables(dbName: String) {
     Database.connect("jdbc:sqlite:${dbName}", "org.sqlite.JDBC")
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
index afb36f0..7572165 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/JSON.kt
@@ -261,7 +261,14 @@ data class FacadeInfo(
     val bankAccountsWrite: MutableList<String> = mutableListOf(),
     val bankConnectionsRead: MutableList<String> = mutableListOf(),
     val bankConnectionsWrite: MutableList<String> = mutableListOf(),
-    val config: Any
+    val config: TalerWireGatewayFacadeConfig /* To be abstracted to Any! */
+)
+
+data class TalerWireGatewayFacadeConfig(
+    val bankAccount: String,
+    val bankConnection: String,
+    val reserveTransferLevel: MutableList<String> = mutableListOf(),
+    val intervalIncremental: String
 )
 
 /**********************************************************************
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
index c9f9e48..e44bc0a 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
@@ -374,7 +374,7 @@ class Taler(app: Route) {
          * that will soon be refunded.)  Recently, the examination of raw 
OUTGOING
          * payment was added as well.
          */
-        app.post("/ebics/taler/{id}/crunch-raw-transactions") {
+        app.post("/{fcid}/taler/{id}/crunch-raw-transactions") {
             val id = ensureNonNull(call.parameters["id"])
             // first find highest ID value of already processed rows.
             transaction {
@@ -463,7 +463,7 @@ class Taler(app: Route) {
          * merchants but possibly to refund invalid incoming payments.  A 
payment is
          * counted only if was once confirmed by the bank.
          */
-        app.get("/taler/history/outgoing") {
+        app.get("/{fcid}/taler/history/outgoing") {
             /* sanitize URL arguments */
             val subscriberId = authenticateRequest(call.request)
             val delta: Int = expectInt(call.expectUrlParameter("delta"))
@@ -501,7 +501,7 @@ class Taler(app: Route) {
             return@get
         }
         /** Responds only with the valid incoming payments */
-        app.get("/taler/history/incoming") {
+        app.get("/{fcid}/taler/history/incoming") {
             val exchangeUser = authenticateRequest(call.request)
             val delta: Int = expectInt(call.expectUrlParameter("delta"))
             val start: Long = 
handleStartArgument(call.request.queryParameters["start"], delta)

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