aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-23 19:01:28 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-23 19:01:28 +0200
commitb054c969cbd84f7ed0f61da3db6a8168b944318f (patch)
treec0ffbd484e5edfa11382fbdc2a50f225371509dc /src/exchangedb
parentcf358f9546c89d9a52c444d18def703547a9d223 (diff)
downloadexchange-b054c969cbd84f7ed0f61da3db6a8168b944318f.tar.xz
-add more accounting fields to reserve table
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/common-0001.sql6
-rw-r--r--src/exchangedb/exchange-0001-part.sql10
2 files changed, 14 insertions, 2 deletions
diff --git a/src/exchangedb/common-0001.sql b/src/exchangedb/common-0001.sql
index 1bf3e6308..a96b91fa1 100644
--- a/src/exchangedb/common-0001.sql
+++ b/src/exchangedb/common-0001.sql
@@ -106,6 +106,10 @@ BEGIN
',reserve_pub BYTEA PRIMARY KEY CHECK(LENGTH(reserve_pub)=32)'
',current_balance_val INT8 NOT NULL'
',current_balance_frac INT4 NOT NULL'
+ ',purses_active INT8 NOT NULL DEFAULT(0)'
+ ',purses_allowed INT8 NOT NULL DEFAULT(0)'
+ ',kyc_required BOOLEAN NOT NULL DEFAULT(FALSE)'
+ ',kyc_passed BOOLEAN NOT NULL DEFAULT(FALSE)'
',expiration_date INT8 NOT NULL'
',gc_date INT8 NOT NULL'
') %s ;'
@@ -2331,7 +2335,7 @@ BEGIN
DROP CONSTRAINT IF EXISTS wads_in_pkey CASCADE
,DROP CONSTRAINT IF EXISTS wads_in_wad_id_origin_exchange_url_key
;
-
+
ALTER TABLE IF EXISTS wad_in_entries
DROP CONSTRAINT IF EXISTS wad_in_entries_pkey CASCADE
;
diff --git a/src/exchangedb/exchange-0001-part.sql b/src/exchangedb/exchange-0001-part.sql
index b3e62a1e6..0a333880b 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -99,7 +99,15 @@ COMMENT ON TABLE reserves
COMMENT ON COLUMN reserves.reserve_pub
IS 'EdDSA public key of the reserve. Knowledge of the private key implies ownership over the balance.';
COMMENT ON COLUMN reserves.current_balance_val
- IS 'Current balance remaining with the reserve';
+ IS 'Current balance remaining with the reserve.';
+COMMENT ON COLUMN reserves.purses_active
+ IS 'Number of purses that were created by this reserve that are not expired and not fully paid.';
+COMMENT ON COLUMN reserves.purses_allowed
+ IS 'Number of purses that this reserve is allowed to have active at most.';
+COMMENT ON COLUMN reserves.kyc_required
+ IS 'True if a KYC check must have been passed before withdrawing from this reserve. Set to true once a reserve received a P2P payment.';
+COMMENT ON COLUMN reserves.kyc_passed
+ IS 'True once KYC was passed for this reserve. The KYC details are then available via the wire_targets table under the key of wire_target_h_payto which is to be derived from the reserve_pub and the base URL of this exchange.';
COMMENT ON COLUMN reserves.expiration_date
IS 'Used to trigger closing of reserves that have not been drained after some time';
COMMENT ON COLUMN reserves.gc_date