diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-05-16 20:15:51 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-07-29 12:18:42 +0200 |
commit | 78900b241c9a3a7e3dfa5b01eadb7cde31c33ecf (patch) | |
tree | 9078460e273781f2cda8862769cd3bc63d41a250 /src/exchangedb/pg_lookup_kyc_requirement_by_row.c | |
parent | 8bb746f3a6e0f0884e4240c46abfd00162f8636a (diff) |
implement pg_lookup_kyc_requirement_by_row
Diffstat (limited to 'src/exchangedb/pg_lookup_kyc_requirement_by_row.c')
-rw-r--r-- | src/exchangedb/pg_lookup_kyc_requirement_by_row.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c index 53df2f441..8f625b2bf 100644 --- a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c +++ b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c @@ -25,6 +25,7 @@ #include "pg_lookup_kyc_requirement_by_row.h" #include "pg_helper.h" + enum GNUNET_DB_QueryStatus TEH_PG_lookup_kyc_requirement_by_row ( void *cls, @@ -42,26 +43,36 @@ TEH_PG_lookup_kyc_requirement_by_row ( GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { - GNUNET_PQ_result_spec_string ("required_checks", - requirements), - GNUNET_PQ_result_spec_auto_from_type ("h_payto", - h_payto), GNUNET_PQ_result_spec_allow_null ( - GNUNET_PQ_result_spec_uint32 ("status", - &status), + GNUNET_PQ_result_spec_auto_from_type ("account_pub", + account_pub), + NULL), + GNUNET_PQ_result_spec_auto_from_type ("access_token", + access_token), + GNUNET_PQ_result_spec_allow_null ( + TALER_PQ_result_spec_json ("jrules", + jrules), NULL), + GNUNET_PQ_result_spec_bool ("aml_review", + aml_review), + GNUNET_PQ_result_spec_bool ("kyc_required", + kyc_required), GNUNET_PQ_result_spec_end }; enum GNUNET_DB_QueryStatus qs; + *jrules = NULL; + memset (account_pub, + 0, + sizeof (*account_pub)); PREPARE (pg, - "lookup_legitimization_requirement_by_row", + "lookup_kyc_requirement_by_row", "SELECT " - " lm.access_token" - ",lo.to_investigate AS aml_review" // can be NULL => false! - ",lo.jnew_rules AS jrules" // can be NULL! => default rules! - ",lm.is_finished AS NOT kyc_required" - ",wt.target_pub AS account_pub" // can be NULL! + " wt.target_pub AS account_pub" + ",lm.access_token" + ",lo.jnew_rules AS jrules" + ",lo.to_investigate AS aml_review" + ",NOT lm.is_finished AS kyc_required" " FROM legitimization_measures lm" " JOIN wire_targets wt" " USING (access_token)" @@ -70,7 +81,7 @@ TEH_PG_lookup_kyc_requirement_by_row ( " WHERE legitimization_measure_serial_id=$1;"); return GNUNET_PQ_eval_prepared_singleton_select ( pg->conn, - "lookup_legitimization_requirement_by_row", + "lookup_kyc_requirement_by_row", params, rs); } |