From 1009084e94b8e8cf19e3b5568c3cccaba2bd2209 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Thu, 11 Aug 2022 23:35:33 +0200
Subject: major rework of the KYC logic, making it more configurable, not
 complete, but tests pass again

---
 src/exchangedb/exchange-0001-part.sql | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'src/exchangedb/exchange-0001-part.sql')

diff --git a/src/exchangedb/exchange-0001-part.sql b/src/exchangedb/exchange-0001-part.sql
index 54b7112f9..792af685e 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -63,6 +63,22 @@ COMMENT ON TABLE denomination_revocations
   IS 'remembering which denomination keys have been revoked';
 
 
+
+-- -------------------------- kyc_alerts ----------------------------------------
+
+CREATE TABLE IF NOT EXISTS kyc_alerts
+  (h_payto BYTEA PRIMARY KEY CHECK (LENGTH(h_payto)=32)
+  ,trigger_type INT4 NOT NULL
+  ,UNIQUE(trigger_type,h_payto)
+  );
+COMMENT ON TABLE kyc_alerts
+  IS 'alerts about completed KYC events reliably notifying other components (even if they are not running)';
+COMMENT ON COLUMN kyc_alerts.h_payto
+  IS 'hash of the payto://-URI for which the KYC status changed';
+COMMENT ON COLUMN kyc_alerts.trigger_type
+  IS 'identifies the receiver of the alert, as the same h_payto may require multiple components to be notified';
+
+
 -- ------------------------------ profit drains ----------------------------------------
 
 CREATE TABLE IF NOT EXISTS profit_drains
-- 
cgit v1.2.3

