aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2023-10-18 15:53:52 +0200
committerMS <ms@taler.net>2023-10-18 15:53:52 +0200
commit12cbce2f9bdadb00e3a4e60ab4fc861ad5426ae8 (patch)
tree845aa6812ecbfcb6820bc4dba7fdb29aa8642350
parente670ab6a3ab5bf2851eed8f4fb58405967b812f0 (diff)
downloadlibeufin-12cbce2f9bdadb00e3a4e60ab4fc861ad5426ae8.tar.gz
libeufin-12cbce2f9bdadb00e3a4e60ab4fc861ad5426ae8.tar.bz2
libeufin-12cbce2f9bdadb00e3a4e60ab4fc861ad5426ae8.zip
Makefile target for Nexus.
And importing database files. Note: "make install" installs only the bank at the moment.
-rw-r--r--Makefile34
-rw-r--r--contrib/libeufin-nexus.conf61
-rw-r--r--database-versioning/drop-nexus.sql7
-rw-r--r--database-versioning/libeufin-nexus-0001.sql66
-rw-r--r--database-versioning/libeufin-nexus-drop.sql6
-rw-r--r--database-versioning/nexus-0001-refactor.sql369
6 files changed, 157 insertions, 386 deletions
diff --git a/Makefile b/Makefile
index 21f3e549..571125d9 100644
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,14 @@ endef
# Absolute DESTDIR or empty string if DESTDIR unset/empty
abs_destdir=$(abspath $(DESTDIR))
-sql_dir=$(abs_destdir)$(prefix)/share/libeufin-bank/sql
-config_dir=$(abs_destdir)$(prefix)/share/libeufin-bank/config.d
+bank_sql_dir=$(abs_destdir)$(prefix)/share/libeufin-bank/sql
+bank_config_dir=$(abs_destdir)$(prefix)/share/libeufin-bank/config.d
spa_dir=$(abs_destdir)$(prefix)/share/libeufin-bank/spa
+# NOT installyed yet along "make install"
+nexus_sql_dir=$(abs_destdir)$(prefix)/share/libeufin-nexus/sql
+nexus_config_dir=$(abs_destdir)$(prefix)/share/libeufin-nexus/config.d
+
.PHONY: dist
dist:
$(call versions_check)
@@ -29,19 +33,29 @@ dist:
deb:
dpkg-buildpackage -rfakeroot -b -uc -us
-
.PHONY: install
-install:
- install -d $(config_dir)
- install contrib/libeufin-bank.conf $(config_dir)/
- install contrib/currencies.conf $(config_dir)/
- install -D database-versioning/libeufin-bank*.sql -t $(sql_dir)
- install -D database-versioning/versioning.sql -t $(sql_dir)
- install -D database-versioning/procedures.sql -t $(sql_dir)
+install: install-bank
+
+.PHONY: install-bank
+install-bank:
+ install -d $(bank_config_dir)
+ install contrib/libeufin-bank.conf $(bank_config_dir)/
+ install contrib/currencies.conf $(bank_config_dir)/
+ install -D database-versioning/libeufin-bank*.sql -t $(bank_sql_dir)
+ install -D database-versioning/versioning.sql -t $(bank_sql_dir)
+ install -D database-versioning/procedures.sql -t $(bank_sql_dir)
install -d $(spa_dir)
cp contrib/wallet-core/demobank/* $(spa_dir)/
./gradlew -q -Pprefix=$(abs_destdir)$(prefix) bank:installToPrefix
+install-nexus:
+ install -d $(nexus_config_dir)
+ install contrib/libeufin-nexus.conf $(nexus_config_dir)/
+ install -D database-versioning/libeufin-nexus*.sql -t $(nexus_sql_dir)
+ install -D database-versioning/versioning.sql -t $(nexus_sql_dir)
+ install -D database-versioning/procedures.sql -t $(nexus_sql_dir)
+ ./gradlew -q -Pprefix=$(abs_destdir)$(prefix) nexus:installToPrefix
+
.PHONY: assemble
assemble:
./gradlew assemble
diff --git a/contrib/libeufin-nexus.conf b/contrib/libeufin-nexus.conf
new file mode 100644
index 00000000..16153c81
--- /dev/null
+++ b/contrib/libeufin-nexus.conf
@@ -0,0 +1,61 @@
+
+[nexus-ebics]
+
+# Currency used by the bank where Nexus is client.
+CURRENCY = KUDOS
+
+# Base URL of the bank server.
+HOST_BASE_URL = http://ebics.bank.com/
+
+# EBICS host ID.
+HOST_ID = mybank
+
+# EBICS user ID, as assigned by the bank.
+USER_ID = myuser
+
+
+# EBICS partner ID, as assigned by the bank.
+PARTNER_ID = myorg
+
+# EBICS partner ID, as assigned by the bank.
+SYSTEM_ID = banksys
+
+# Name given by the bank to the bank account driven by Nexus.
+ACCOUNT_NUMBER = DE1234567890
+
+# File that holds the bank EBICS keys.
+BANK_PUBLIC_KEYS_FILE = enc-auth-keys.json
+
+# File that holds the client/Nexus EBICS keys.
+CLIENT_PRIVATE_KEYS_FILE = my-private-keys.json
+
+ACCOUNT_META_DATA_FILE = ebics-meta.json
+
+# Identifies the EBICS + ISO20022 style used by the bank.
+# Typically, it is named after the bank itself.
+BANK_DIALECT = postfinance
+
+[nexus-postgres]
+CONFIG = postgres:///libeufin-nexus
+
+[nexus-ebics-fetch]
+FREQUENCY = 30s # used when long-polling is not supported
+STATEMENT_LOG_DIRECTORY = /tmp/ebics-messages/
+
+[nexus-ebics-submit]
+FREQUENCY = 30s # use 0 to always submit immediately (via LISTEN trigger)
+
+[nexus-httpd]
+PORT = 8080
+UNIXPATH =
+SERVE = tcp | unix
+
+[nexus-httpd-wire-gateway-facade]
+ENABLED = YES
+AUTH_METHOD = token
+AUTH_TOKEN =
+
+[nexus-httpd-revenue-facade]
+ENABLED = YES
+AUTH_METHOD = token
+AUTH_TOKEN =
diff --git a/database-versioning/drop-nexus.sql b/database-versioning/drop-nexus.sql
deleted file mode 100644
index dbddae4e..00000000
--- a/database-versioning/drop-nexus.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-BEGIN;
-
-SELECT _v.unregister_patch('nexus-0001');
-
-DROP SCHEMA nexus CASCADE;
-
-COMMIT;
diff --git a/database-versioning/libeufin-nexus-0001.sql b/database-versioning/libeufin-nexus-0001.sql
new file mode 100644
index 00000000..f12c3fde
--- /dev/null
+++ b/database-versioning/libeufin-nexus-0001.sql
@@ -0,0 +1,66 @@
+--
+-- This file is part of TALER
+-- Copyright (C) 2023 Taler Systems SA
+--
+-- TALER is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 3, or (at your option) any later version.
+--
+-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+-- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License along with
+-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+
+BEGIN;
+
+SELECT _v.register_patch('libeufin-nexus-0001', NULL, NULL);
+
+CREATE SCHEMA libeufin_nexus;
+SET search_path TO libeufin_nexus;
+
+CREATE TYPE taler_amount
+ AS
+ (val INT8
+ ,frac INT4
+ );
+COMMENT ON TYPE taler_amount
+ IS 'Stores an amount, fraction is in units of 1/100000000 of the base value';
+
+CREATE TABLE IF NOT EXISTS incoming_transactions
+ (incoming_transaction_id INT8 GENERATED BY DEFAULT AS IDENTITY
+ ,amount taler_amount NOT NULL
+ ,wire_transfer_subject TEXT
+ ,execution_time INT8 NOT NULL
+ ,debit_payto_uri TEXT NOT NULL
+ ,bank_transfer_id TEXT NOT NULL -- EBICS or Depolymerizer (generic)
+ ,bounced BOOL DEFAULT FALSE -- to track if we bounced it
+ );
+
+CREATE TABLE IF NOT EXISTS outgoing_transactions
+ (outgoing_transaction_id INT8 GENERATED BY DEFAULT AS IDENTITY UNIQUE
+ ,amount taler_amount NOT NULL
+ ,wire_transfer_subject TEXT
+ ,execution_time INT8 NOT NULL
+ ,credit_payto_uri TEXT NOT NULL
+ ,bank_transfer_id TEXT NOT NULL
+ );
+
+CREATE TABLE IF NOT EXISTS initiated_outgoing_transactions
+ (initiated_outgoing_transaction_id INT8 GENERATED BY DEFAULT AS IDENTITY UNIQUE -- used as our ID in PAIN
+ ,amount taler_amount NOT NULL
+ ,wire_transfer_subject TEXT
+ ,execution_time INT8 NOT NULL
+ ,credit_payto_uri TEXT NOT NULL
+ ,outgoing_transaction_id INT8 REFERENCES outgoing_transactions (outgoing_transaction_id)
+ ,submitted BOOL DEFAULT FALSE
+ ,hidden BOOL DEFAULT FALSE -- FIXME: exaplain this.
+ ,client_request_uuid TEXT NOT NULL UNIQUE
+ ,failure_message TEXT -- NOTE: that may mix soon failures (those found at initiation time), or late failures (those found out along a fetch operation)
+ );
+
+COMMENT ON COLUMN initiated_outgoing_transactions.outgoing_transaction_id
+ IS 'Points to the bank transaction that was found via nexus-fetch. If "submitted" is false or nexus-fetch could not download this initiation, this column is expected to be NULL.';
+
+COMMIT;
diff --git a/database-versioning/libeufin-nexus-drop.sql b/database-versioning/libeufin-nexus-drop.sql
new file mode 100644
index 00000000..51f13a06
--- /dev/null
+++ b/database-versioning/libeufin-nexus-drop.sql
@@ -0,0 +1,6 @@
+BEGIN;
+
+SELECT _v.unregister_patch('libeufin-nexus-0001');
+DROP SCHEMA libeufin_nexus CASCADE;
+
+COMMIT;
diff --git a/database-versioning/nexus-0001-refactor.sql b/database-versioning/nexus-0001-refactor.sql
deleted file mode 100644
index 92c6f947..00000000
--- a/database-versioning/nexus-0001-refactor.sql
+++ /dev/null
@@ -1,369 +0,0 @@
--- NOTE: REFACTORING IN PROGRESS IN THIS FILE. THIS
--- FILE IS NOT EMPLOYED YET.
-
---
--- This file is part of TALER
--- Copyright (C) 2023 Taler Systems SA
---
--- TALER is free software; you can redistribute it and/or modify it under the
--- terms of the GNU General Public License as published by the Free Software
--- Foundation; either version 3, or (at your option) any later version.
---
--- TALER is distributed in the hope that it will be useful, but WITHOUT ANY
--- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
--- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
---
--- You should have received a copy of the GNU General Public License along with
--- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
---
--- To Do: comments, although '--' vs 'COMMENT ON' is under discussion.
-
-BEGIN;
-
-SELECT _v.register_patch('nexus-0001', NULL, NULL);
-
-CREATE SCHEMA nexus;
-SET search_path TO nexus;
-
-CREATE TYPE taler_amount
- AS
- (val INT8
- ,frac INT4
- );
-COMMENT ON TYPE taler_amount
- IS 'Stores an amount, fraction is in units of 1/100000000 of the base value';
-
-CREATE TYPE resource_enum
- AS ENUM ('account', 'connection', 'facade');
-
-CREATE TYPE fetch_level_enum
- AS ENUM ('report', 'statement', 'notification');
-
-CREATE TYPE direction_enum
- AS ENUM ('credit', 'debit');
-
-CREATE TYPE transaction_state_enum
- AS ENUM ('pending', 'booked');
-
-CREATE TYPE ebics_key_state_enum
- AS ENUM ('sent', 'notsent');
-
--- start of: user management
-
--- This table accounts the users registered at Nexus
--- without any mention of banking connections.
-CREATE TABLE IF NOT EXISTS nexus_logins
- (nexus_login_id BIGINT GENERATED BY DEFAULT AS IDENTITY
- ,login TEXT NOT NULL PRIMARY KEY
- ,password TEXT NOT NULL
- ,superuser BOOLEAN NOT NULL DEFAULT (false)
- );
-
-COMMENT ON TABLE nexususers
- IS 'xxx';
-COMMENT ON COLUMN nexususers.password
- IS 'hashed password - FIXME: which hash, how encoded, salted?';
-
--- end of: user management
-
--- 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
- (connection_id BIGINT GENERATED BY DEFAULT AS IDENTITY
- ,connection_label TEXT NOT NULL
- ,connection_type TEXT NOT NULL
- ,nexus_login_id BIGINT NOT NULL
- REFERENCES nexus_users(nexus_login_id)
- ON DELETE CASCADE 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
- (subscriber_id BIGSERIAL PRIMARY KEY
- ,ebics_url TEXT NOT NULL
- ,host_id TEXT NOT NULL
- ,partner_id TEXT NOT NULL
- ,nexus_login_id BIGINT NOT NULL
- REFERENCES nexus_users(nexus_login_id)
- ON DELETE CASCADE ON UPDATE RESTRICT
- ,system_id TEXT DEFAULT (NULL)
- ,dialect TEXT DEFAULT (NULL)
- ,signature_private_key BYTEA NOT NULL
- ,encryption_private_key BYTEA NOT NULL
- ,authentication_private_key BYTEA NOT NULL
- ,bank_encryption_public_key BYTEA DEFAULT(NULL)
- ,bank_authentication_public_key BYTEA NULL
- ,connection_id BIGINT NOT NULL
- REFERENCES nexus_bank_connections(connection_id)
- ON DELETE RESTRICT ON UPDATE RESTRICT
- ,ebics_ini_state ebics_key_state NOT NULL DEFAULT TO 'notsent'
- ,ebics_hia_state ebics_key_state NOT NULL DEFAULT TO 'notsent'
- );
-
--- 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
- (bank_user_id BIGSERIAL PRIMARY KEY
- ,bank_username TEXT NOT NULL
- ,bank_password TEXT NOT NULL
- ,bank_base_url TEXT NOT NULL
- ,bank_connection_id BIGINT NOT NULL
- REFERENCES nexus_bank_connections(connection_id)
- ON DELETE CASCADE 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
- (offered_bank_account_id BIGSERIAL PRIMARY KEY
- ,offered_account_id TEXT NOT NULL
- ,connection_id BIGINT NOT NULL
- REFERENCES nexusbankconnections(connection_id)
- ON DELETE CASCADE
- ON UPDATE RESTRICT
- ,iban TEXT NOT NULL
- ,bank_code TEXT NOT NULL
- ,holder_name TEXT NOT NULL
- ,imported BIGINT DEFAULT(NULL)
- REFERENCES nexus_bank_accounts(account_id)
- ON DELETE RESTRICT
- ON UPDATE RESTRICT
- ,UNIQUE (offered_account_id, connection_id)
- );
-
--- end of: connection management
-
--- start of: background tasks
-
--- Accounts for the background tasks that were created by the user.
-CREATE TABLE IF NOT EXISTS nexus_scheduled_tasks
- (id BIGSERIAL PRIMARY KEY
- ,resource_type resource_enum NOT NULL
- ,resource_id TEXT NOT NULL
- ,task_name TEXT NOT NULL
- ,task_type TEXT NOT NULL
- ,task_cronspec TEXT NOT NULL
- ,task_params TEXT NOT NULL
- ,next_scheduled_execution_sec BIGINT NULL
- ,last_scheduled_execution_sec BIGINT NULL
- );
-
--- end of: background tasks
-
--- start of: core banking
-
--- A bank account managed by Nexus. Each row corresponds to an
--- actual bank account at the bank and that is owned by the 'account_holder'
--- column.
-CREATE TABLE IF NOT EXISTS nexus_bank_accounts
- (nexus_account_id BIGSERIAL PRIMARY KEY
- ,nexus_account_label TEXT NOT NULL UNIQUE
- ,nexus_account_holder TEXT NOT NULL
- ,iban TEXT NOT NULL
- ,bank_code TEXT NOT NULL
- ,default_connection_id BIGINT DEFAULT(NULL)
- REFERENCES nexus_bank_connections(connection_id)
- ON DELETE SET NULL
- ,last_statement_creation_timestamp BIGINT NULL
- ,last_report_creation_timestamp BIGINT NULL
- ,last_notification_creation_timestamp BIGINT NULL
- ,highest_seen_bank_message_serial_id BIGINT NOT NULL
- );
-
--- start of: facades management
-
-CREATE TABLE IF NOT EXISTS facades
- (facade_id BIGSERIAL PRIMARY KEY
- ,facade_label TEXT NOT NULL UNIQUE
- ,facace_type TEXT NOT NULL
- ,creator_login_id BIGINT NOT NULL
- REFERENCES nexus_logins(nexus_login_id)
- ON DELETE CASCADE
- ON UPDATE RESTRICT
- );
-
--- Basic information about the facade state.
-CREATE TABLE IF NOT EXISTS wire_gateway_facade_state
- (wire_gateway_facade_state_id BIGSERIAL PRIMARY KEY
- ,nexus_bank_account BIGINT NOT NULL
- REFERENCES nexus_bank_accounts(nexus_account_id)
- ,connection_id BIGINT NOT NULL
- REFERENCES nexus_bank_connections (connection_id)
- -- Taler maximum is 11 plus 0-terminator
- ,currency VARCHAR(11) NOT NULL
- -- The following column informs whether this facade
- -- wants payment data to come from statements (usually
- -- once a day when the payment is very likely settled),
- -- reports (multiple times a day but the payment might
- -- not be settled). "report" or "statement" or "notification"
- ,reserve_transfer_level TEXT NOT NULL
- ,facade_id BIGINT NOT NULL
- REFERENCES facades(id)
- ON DELETE CASCADE
- ON UPDATE RESTRICT
- -- The following column points to the last transaction
- -- that was processed already by the facade. It's used
- -- along the facade-specific ingestion.
- ,highest_seen_message_serial_id BIGINT DEFAULT 0 NOT NULL
- );
-
-
--- FIXME: will 'permissions' survive the upcoming Nexus simplification?
-CREATE TABLE IF NOT EXISTS nexus_permissions
- (permission_id BIGSERIAL PRIMARY KEY
- ,resource_type resource_enum NOT NULL
- ,resource_id BIGINT NOT NULL -- comment: references X/Y/Z depending on resource_type
- ,subject_type TEXT NOT NULL -- fixme: enum?
- ,subject_name TEXT NOT NULL -- fixme: bigint?
- ,permission_name TEXT NOT NULL -- fixme: enum!
- ,UNIQUE(resource_type, resource_id, subject_type, subject_name, permission_name)
- );
-
--- end of: general facades management
-
--- start of: Taler facade management
-
--- All the payments that were ingested by Nexus. Each row
--- points at the Nexus bank account that is related to the transaction.
-CREATE TABLE IF NOT EXISTS nexus_bank_transactions
- (transaction_id BIGSERIAL PRIMARY KEY
- ,account_transaction_id TEXT NOT NULL
- ,nexus_account_account_id NOT NULL
- REFERENCES nexus_bank_accounts(nexus_account_id)
- ON DELETE RESTRICT ON UPDATE RESTRICT
- ,credit_debit_indicator direction_enum NOT NULL
- ,currency TEXT NOT NULL
- ,amount taler_amount NOT NULL
- ,status transaction_state_enum NOT NULL
- ,transaction_json TEXT NOT NULL
- );
-
-
--- Holds valid Taler payments, typically those that are returned
--- to the Wirewatch by the Taler facade.
-CREATE TABLE IF NOT EXISTS taler_incoming_payments
- (taler_payment_id BIGSERIAL PRIMARY KEY
- ,transaction_id NOT NULL
- REFERENCES nexus_bank_transactions(transaction_id)
- ON DELETE CASCADE
- ON UPDATE RESTRICT
- ,reserve_public_key BYTEA CHECK(LENGTH(reserve_public_key)=32)
- ,timestamp BIGINT NOT NULL
- ,incoming_payto_uri TEXT NOT NULL
- );
-
-
--- Table holding the data that represent one outgoing payment
--- made by the (user owning the) 'bank_account'. The 'raw_confirmation'
--- column points at the global table of all the ingested payments
--- where the pointed ingested payment is the confirmation that the
--- pointing payment initiation was finalized at the bank. All
--- the IDs involved in this table mimic the semantics of ISO20022 pain.001.
-CREATE TABLE IF NOT EXISTS payment_initiations
- (payment_initiation_id BIGSERIAL PRIMARY KEY
- ,nexus_bank_account_id BIGINT NOT NULL
- REFERENCES nexus_bank_accounts(nexus_bank_account_id)
- ON DELETE CASCADE
- ON UPDATE RESTRICT
- ,preparation_date BIGINT NOT NULL
- ,submission_date BIGINT NULL
- ,transaction_sum taler_amount NOT NULL
- ,currency TEXT NOT NULL
- ,end_to_end_id TEXT NOT NULL
- ,payment_information_id TEXT NOT NULL
- ,instruction_id TEXT NOT NULL
- ,subject TEXT NOT NULL
- ,creditor_iban TEXT NOT NULL
- ,creditor_bic TEXT NULL
- ,creditor_name TEXT NOT NULL
- ,submitted BOOLEAN DEFAULT FALSE NOT NULL
- ,invalid BOOLEAN -- does NULL mean _likely_ valid?
- ,message_id TEXT NOT NULL
- ,confirmation_transaction_id BIGINT NULL
- REFERENCES nexus_bank_transactions(transaction_id)
- ON DELETE SET NULL
- ON UPDATE RESTRICT
- );
-
-
--- This table holds the outgoing payments that were requested
--- by the exchange to pay merchants. The columns reflect the
--- data model of the /transfer call from the TWG.
-CREATE TABLE IF NOT EXISTS taler_requested_payments
- (taler_payment_request_id BIGSERIAL PRIMARY KEY
- ,facade_id NOT NULL
- REFERENCES facades(facade_id)
- ON DELETE CASCADE
- ON UPDATE RESTRICT
- ,payment_initiation_id NOT NULL
- REFERENCES payment_initiations(payment_initiation_id)
- ON DELETE CASCADE
- ON UPDATE RESTRICT
- ,request_uid TEXT NOT NULL
- ,amount taler_amount NOT NULL -- currency from facade
- ,exchange_base_url TEXT NOT NULL
- ,wtid TEXT NOT NULL
- ,credit_account_payto_uri TEXT NOT NULL
- );
-
-
--- Typically contains payments with an invalid reserve public
--- key as the subject. The 'payment' columns points at the ingested
--- transaction that is invalid in the Taler sense.
-CREATE TABLE IF NOT EXISTS taler_invalid_incoming_payments
- (taler_invalid_incoming_payment_id BIGSERIAL PRIMARY KEY
- ,transaction_id NOT NULL
- REFERENCES nexus_bank_transactions(transaction_id)
- ON DELETE RESTRICT ON UPDATE RESTRICT
- ,timestamp BIGINT NOT NULL
- ,refunded BOOLEAN DEFAULT false NOT NULL
- );
-
--- end of: Taler facade management
-
--- start of: Anastasis facade management
-
-CREATE TABLE IF NOT EXISTS anastasis_incoming_payments
- (anastasis_incoming_payments_id BIGSERIAL PRIMARY KEY
- ,transaction_id NOT NULL
- REFERENCES nexus_bank_transactions(id)
- ON DELETE RESTRICT ON UPDATE RESTRICT
- ,subject TEXT NOT NULL
- ,timestamp BIGINT NOT NULL
- ,incoming_payto_uri TEXT NOT NULL
- );
-
--- end of: Anastasis facade management
-
-CREATE TABLE IF NOT EXISTS nexus_bank_messages
- (bank_message_id BIGSERIAL PRIMARY KEY
- ,bank_connection BIGINT NOT NULL
- REFERENCES nexus_bank_connections(connection_id)
- ON DELETE CASCADE
- ON UPDATE RESTRICT
- ,message BYTEA NOT NULL
- ,message_id TEXT NULL
- ,fetch_level fetch_level_enum NOT NULL
- ,errors BOOLEAN DEFAULT FALSE NOT NULL
- );
-COMMENT ON TABLE nexus_bank_messages
- IS 'This table holds the business content that came from the
-bank. Storing messages here happens with problematic messages,
-or when the storing is enabled. By default, successful messages
-are never stored.'
-
-
--- end of: core banking
-
-COMMIT