aboutsummaryrefslogtreecommitdiff
path: root/src/backenddb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-07-31 19:01:45 +0200
committerChristian Grothoff <christian@grothoff.org>2024-07-31 19:01:45 +0200
commit854bad7d7c220c9ea9f4d61eb8fd46548a160da2 (patch)
tree7acb0f2077df215ab4128fbf721196cb09465e08 /src/backenddb
parent4a312017e07335a7285d6a984f4a2a3882877288 (diff)
DB schema change for storing more KYC status data
Diffstat (limited to 'src/backenddb')
-rw-r--r--src/backenddb/merchant-0010.sql26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/backenddb/merchant-0010.sql b/src/backenddb/merchant-0010.sql
index e7ac0dc3..7f3504e9 100644
--- a/src/backenddb/merchant-0010.sql
+++ b/src/backenddb/merchant-0010.sql
@@ -29,7 +29,31 @@ SET search_path TO merchant;
ALTER TABLE merchant_kyc
DROP COLUMN aml_decision
,DROP COLUMN exchange_sig
- ,DROP COLUMN exchange_pub;
+ ,DROP COLUMN exchange_pub
+ ,ADD COLUMN access_token BLOB DEFAULT NULL
+ ,ADD COLUMN exchange_http_status INT4 DEFAULT(0)
+ ,ADD COLUMN exchange_ec_code INT4 DEFAULT(0)
+ ,ADD COLUMN aml_review BOOL DEFAULT(FALSE)
+ ,ADD COLUMN deposit_threshold taler_amount_currency[] DEFAULT NULL
+ ,ADD COLUMN deposit_timeframe INT8[] DEFAULT NULL
+ ,ADD COLUMN deposit_limit_is_soft BOOL[] DEFAULT NULL
+ ,ADD CONSTRAINT access_token_length_check CHECK (LENGTH(access_token) = 32);
+
+COMMENT ON COLUMN merchant_kyc.access_token
+ IS 'Access token required to begin the KYC process';
+COMMENT ON COLUMN merchant_kyc.exchange_http_status
+ IS 'Last HTTP status returned by the exchange when inquiring about our KYC status.';
+COMMENT ON COLUMN merchant_kyc.exchange_ec_code
+ IS 'Last Taler error code returned by the exchange when inquiring about our KYC status.';
+COMMENT ON COLUMN merchant_kyc.aml_review
+ IS 'True if our account is under AML review according to the exchange.';
+COMMENT ON COLUMN merchant_kyc.deposit_threshold
+ IS 'Maximum amount we are allowed to deposit in a given timeframe under current rules.';
+COMMENT ON COLUMN merchant_kyc.deposit_timeframe
+ IS 'Timeframe for which the deposit_threshold applies.';
+COMMENT ON COLUMN merchant_kyc.deposit_limit_is_soft
+ IS 'True if this is a soft limit';
+
-- Complete transaction
COMMIT;