[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 115/124: -fix SQL
From: |
gnunet |
Subject: |
[taler-exchange] 115/124: -fix SQL |
Date: |
Tue, 17 Sep 2024 21:28:47 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag cg-aml-branch-compiles
in repository exchange.
commit 15270c5ec7edececa983f99af0bf93850d1f0735
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Jul 24 17:35:31 2024 +0200
-fix SQL
---
.../exchange_do_insert_kyc_attributes.sql | 50 ++++++++++++++++++----
1 file changed, 41 insertions(+), 9 deletions(-)
diff --git a/src/exchangedb/exchange_do_insert_kyc_attributes.sql
b/src/exchangedb/exchange_do_insert_kyc_attributes.sql
index 8ae2ff0c3..0ff25e917 100644
--- a/src/exchangedb/exchange_do_insert_kyc_attributes.sql
+++ b/src/exchangedb/exchange_do_insert_kyc_attributes.sql
@@ -14,8 +14,7 @@
-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
--
-DELETE FUNCTION exchange_do_insert_kyc_attributes
- IF EXISTS;
+DROP FUNCTION IF EXISTS exchange_do_insert_kyc_attributes;
CREATE FUNCTION exchange_do_insert_kyc_attributes(
IN in_process_row INT8,
IN in_h_payto BYTEA,
@@ -26,11 +25,11 @@ CREATE FUNCTION exchange_do_insert_kyc_attributes(
IN in_collection_time_ts INT8,
IN in_expiration_time INT8,
IN in_expiration_time_ts INT8,
- IN in_account_properties TEXT, -- FIXME: use!
- IN in_new_rules TEXT, -- FIXME: use!
- IN ina_events TEXT[], -- FIXME: use!
+ IN in_account_properties TEXT,
+ IN in_new_rules TEXT,
+ IN ina_events TEXT[],
IN in_enc_attributes BYTEA,
- IN in_require_aml BOOLEAN,
+ IN in_to_investigate BOOLEAN,
IN in_kyc_completed_notify_s TEXT,
OUT out_ok BOOLEAN)
LANGUAGE plpgsql
@@ -38,9 +37,31 @@ AS $$
DECLARE
orig_reserve_pub BYTEA;
orig_reserve_found BOOLEAN;
+ my_trigger_outcome_serial INT8;
+ my_i INT4;
+ ini_event TEXT;
BEGIN
-INSERT INTO exchange.kyc_attributes
+INSERT INTO legitimization_outcomes
+ (h_payto
+ ,decision_time
+ ,expiration_time
+ ,jproperties
+ ,to_investigate
+ ,jnew_rules)
+VALUES
+ (in_h_payto
+ ,in_collection_time_ts
+ ,in_expiration_time_ts
+ ,in_account_properties
+ ,in_to_investigate
+ ,in_new_rules)
+RETURNING
+ outcome_serial_id
+INTO
+ my_trigger_outcome_serial;
+
+INSERT INTO kyc_attributes
(h_payto
,collection_time
,expiration_time
@@ -53,7 +74,7 @@ INSERT INTO exchange.kyc_attributes
,in_expiration_time_ts
,in_enc_attributes
,in_process_row
- ,FIXME);
+ ,my_trigger_outcome_serial);
UPDATE legitimization_processes
SET provider_user_id=in_provider_account_id
@@ -82,7 +103,7 @@ THEN
WHERE reserve_pub=orig_reserve_pub;
END IF;
-IF in_require_aml
+IF in_to_investigate
THEN
INSERT INTO exchange.aml_status
(h_payto
@@ -94,6 +115,17 @@ THEN
UPDATE SET status=EXCLUDED.status | 1;
END IF;
+FOR i IN 1..array_length(ina_events,1)
+LOOP
+ ini_event = ina_events[i];
+ INSERT INTO kyc_events
+ (event_timestamp
+ ,event_type)
+ VALUES
+ (in_collection_time_ts
+ ,ini_event);
+END LOOP;
+
EXECUTE FORMAT (
'NOTIFY %s'
,in_kyc_completed_notify_s);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 84/124: add account_sig for authorization, (continued)
- [taler-exchange] 84/124: add account_sig for authorization, gnunet, 2024/09/17
- [taler-exchange] 112/124: more bugfixes, gnunet, 2024/09/17
- [taler-exchange] 48/124: add spa logic, gnunet, 2024/09/17
- [taler-exchange] 97/124: fix leak, expand logging, gnunet, 2024/09/17
- [taler-exchange] 96/124: -SQL fixes, gnunet, 2024/09/17
- [taler-exchange] 88/124: implement wad_in_insert, gnunet, 2024/09/17
- [taler-exchange] 104/124: new test command for KYC wire transfers, gnunet, 2024/09/17
- [taler-exchange] 90/124: pass h_payto, gnunet, 2024/09/17
- [taler-exchange] 93/124: return KYCAUTH transfers from fakebank account history API, gnunet, 2024/09/17
- [taler-exchange] 117/124: WiP, gnunet, 2024/09/17
- [taler-exchange] 115/124: -fix SQL,
gnunet <=
- [taler-exchange] 120/124: -misc bugfixes, gnunet, 2024/09/17
- [taler-exchange] 64/124: get AML measures skeleton", gnunet, 2024/09/17
- [taler-exchange] 69/124: -towards form uploads (incomplete), gnunet, 2024/09/17
- [taler-exchange] 124/124: fix test_kyc_api FTBFS, gnunet, 2024/09/17
- [taler-exchange] 92/124: implement new admin kycauth incoming endpoint in fakebank, gnunet, 2024/09/17
- [taler-exchange] 81/124: ign, gnunet, 2024/09/17
- [taler-exchange] 106/124: -fixing minor bugs, gnunet, 2024/09/17
- [taler-exchange] 86/124: start with wire-gateway API v1 implementation, gnunet, 2024/09/17
- [taler-exchange] 99/124: parse more of check configuration, gnunet, 2024/09/17
- [taler-exchange] 87/124: skeleton, gnunet, 2024/09/17