From d189fccd790a36046e1191d7170f45feb3dfb122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sun, 23 Jul 2023 12:48:07 +0200 Subject: Added reserve_pub to kyc legitimization_processes Where applicable, the reserve_pub will be passed on to the kcy-legitimization process and persisted along with h_payto. This allows us to set a birthday on the reserve itself, once a related kyc-process has provided one. --- src/exchangedb/pg_insert_kyc_requirement_process.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/exchangedb/pg_insert_kyc_requirement_process.c') diff --git a/src/exchangedb/pg_insert_kyc_requirement_process.c b/src/exchangedb/pg_insert_kyc_requirement_process.c index f1ea5b490..ddd765b99 100644 --- a/src/exchangedb/pg_insert_kyc_requirement_process.c +++ b/src/exchangedb/pg_insert_kyc_requirement_process.c @@ -24,6 +24,7 @@ #include "taler_pq_lib.h" #include "pg_insert_kyc_requirement_process.h" #include "pg_helper.h" +#include enum GNUNET_DB_QueryStatus TEH_PG_insert_kyc_requirement_process ( @@ -32,6 +33,7 @@ TEH_PG_insert_kyc_requirement_process ( const char *provider_section, const char *provider_account_id, const char *provider_legitimization_id, + const struct TALER_ReservePublicKeyP *reserve_pub, uint64_t *process_row) { struct PostgresClosure *pg = cls; @@ -44,6 +46,9 @@ TEH_PG_insert_kyc_requirement_process ( (NULL != provider_legitimization_id) ? GNUNET_PQ_query_param_string (provider_legitimization_id) : GNUNET_PQ_query_param_null (), + (NULL != reserve_pub) + ? GNUNET_PQ_query_param_auto_from_type (reserve_pub) + : GNUNET_PQ_query_param_null (), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -60,12 +65,14 @@ TEH_PG_insert_kyc_requirement_process ( " ,provider_section" " ,provider_user_id" " ,provider_legitimization_id" + " ,reserve_pub" " ) VALUES " - " ($1, $2, $3, $4)" + " ($1, $2, $3, $4, $5)" " ON CONFLICT (h_payto,provider_section) " " DO UPDATE SET" " provider_user_id=$3" " ,provider_legitimization_id=$4" + " ,reserve_pub=$5" " RETURNING legitimization_process_serial_id"); return GNUNET_PQ_eval_prepared_singleton_select ( pg->conn, -- cgit v1.2.3