summaryrefslogtreecommitdiff
path: root/src/exchangedb/exchange-0001-part.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-08-05 13:32:27 +0200
committerChristian Grothoff <christian@grothoff.org>2022-08-05 13:32:27 +0200
commit4724867794c30ab2d61a2f78ad3f8ad919664519 (patch)
tree9ec29dae36f03940af06dbedd0723e3663dcac0e /src/exchangedb/exchange-0001-part.sql
parentc78331b6c23b471bff31b4c05a6b6e1e3e06f42a (diff)
downloadexchange-4724867794c30ab2d61a2f78ad3f8ad919664519.tar.gz
exchange-4724867794c30ab2d61a2f78ad3f8ad919664519.tar.bz2
exchange-4724867794c30ab2d61a2f78ad3f8ad919664519.zip
-first pass at new KYC DB API
Diffstat (limited to 'src/exchangedb/exchange-0001-part.sql')
-rw-r--r--src/exchangedb/exchange-0001-part.sql30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/exchangedb/exchange-0001-part.sql b/src/exchangedb/exchange-0001-part.sql
index 97f5829e6..efff3874c 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -104,8 +104,10 @@ COMMENT ON COLUMN wire_targets.payto_uri
IS 'Can be a regular bank account, or also be a URI identifying a reserve-account (for P2P payments)';
COMMENT ON COLUMN wire_targets.wire_target_h_payto
IS 'Unsalted hash of payto_uri';
+-- FIXME: remove:
COMMENT ON COLUMN wire_targets.kyc_ok
IS 'true if the KYC check was passed successfully';
+-- FIXME: remove:
COMMENT ON COLUMN wire_targets.external_id
IS 'Name of the user that was used for OAuth 2.0-based legitimization';
@@ -115,6 +117,34 @@ CREATE TABLE IF NOT EXISTS wire_targets_default
SELECT add_constraints_to_wire_targets_partition('default');
+
+-- ------------------------------ legitimizations ----------------------------------------
+
+SELECT create_table_legitimizations();
+
+COMMENT ON TABLE legitimizations
+ IS 'List of legitimizations (required and completed) by account and provider';
+COMMENT ON COLUMN legitimizations.legitimization_serial_id
+ IS 'unique ID for this legitimization process at the exchange';
+COMMENT ON COLUMN legitimizations.h_payto
+ IS 'foreign key linking the entry to the wire_targets table, NOT a primary key (multiple legitimizations are possible per wire target)';
+COMMENT ON COLUMN legitimizations.expiration_time
+ IS 'in the future if the respective KYC check was passed successfully';
+COMMENT ON COLUMN legitimizations.provider_section
+ IS 'Configuration file section with details about this provider';
+COMMENT ON COLUMN legitimizations.provider_user_id
+ IS 'Identifier for the user at the provider that was used for the legitimization. NULL if provider is unaware.';
+COMMENT ON COLUMN legitimizations.provider_legitimization_id
+ IS 'Identifier for the specific legitimization process at the provider. NULL if legitimization was not started.';
+
+CREATE TABLE IF NOT EXISTS legitimizations_default
+ PARTITION OF legitimizations
+ FOR VALUES WITH (MODULUS 1, REMAINDER 0);
+
+SELECT add_constraints_to_legitimizations_partition('default');
+
+
+
-- ------------------------------ reserves ----------------------------------------
SELECT create_table_reserves();