aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-04-10 10:48:32 +0200
committerChristian Grothoff <christian@grothoff.org>2023-04-10 10:48:32 +0200
commit090c532b3adcf404c3b602c899c1e995762e0ace (patch)
tree8eea418309d44c95fa5450dbc62e878f75c300de /src/exchangedb
parent677ac4a5c8570115134cda7537c1580bce15e5c4 (diff)
downloadexchange-090c532b3adcf404c3b602c899c1e995762e0ace.tar.xz
return AML status together with KYC status
Diffstat (limited to 'src/exchangedb')
-rw-r--r--src/exchangedb/pg_lookup_kyc_requirement_by_row.c19
-rw-r--r--src/exchangedb/pg_lookup_kyc_requirement_by_row.h3
2 files changed, 17 insertions, 5 deletions
diff --git a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
index 6542aa28f..9651359e2 100644
--- a/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
+++ b/src/exchangedb/pg_lookup_kyc_requirement_by_row.c
@@ -30,9 +30,11 @@ TEH_PG_lookup_kyc_requirement_by_row (
void *cls,
uint64_t requirement_row,
char **requirements,
+ enum TALER_AmlDecisionState *aml_status,
struct TALER_PaytoHashP *h_payto)
{
struct PostgresClosure *pg = cls;
+ uint32_t status;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&requirement_row),
GNUNET_PQ_query_param_end
@@ -42,19 +44,26 @@ TEH_PG_lookup_kyc_requirement_by_row (
requirements),
GNUNET_PQ_result_spec_auto_from_type ("h_payto",
h_payto),
+ GNUNET_PQ_result_spec_uint32 ("status",
+ &status),
GNUNET_PQ_result_spec_end
};
-/* Used in #postgres_lookup_kyc_requirement_by_row() */
+ enum GNUNET_DB_QueryStatus qs;
+
PREPARE (pg,
"lookup_legitimization_requirement_by_row",
"SELECT "
- " required_checks"
- ",h_payto"
- " FROM legitimization_requirements"
+ " lr.required_checks"
+ ",lr.h_payto"
+ ",aml.status"
+ " FROM legitimization_requirements lr"
+ " JOIN aml_status aml USING (h_payto)"
" WHERE legitimization_requirement_serial_id=$1;");
- return GNUNET_PQ_eval_prepared_singleton_select (
+ qs = GNUNET_PQ_eval_prepared_singleton_select (
pg->conn,
"lookup_legitimization_requirement_by_row",
params,
rs);
+ *aml_status = (enum TALER_AmlDecisionState) status;
+ return qs;
}
diff --git a/src/exchangedb/pg_lookup_kyc_requirement_by_row.h b/src/exchangedb/pg_lookup_kyc_requirement_by_row.h
index 12d726187..3d223c985 100644
--- a/src/exchangedb/pg_lookup_kyc_requirement_by_row.h
+++ b/src/exchangedb/pg_lookup_kyc_requirement_by_row.h
@@ -32,6 +32,7 @@
* @param cls closure
* @param requirement_row identifies requirement to look up
* @param[out] requirements provider that must be checked
+ * @param[out] aml_status set to the AML status of the account
* @param[out] h_payto account that must be KYC'ed
* @return database transaction status
*/
@@ -40,5 +41,7 @@ TEH_PG_lookup_kyc_requirement_by_row (
void *cls,
uint64_t requirement_row,
char **requirements,
+ enum TALER_AmlDecisionState *aml_status,
struct TALER_PaytoHashP *h_payto);
+
#endif