commit d1a4fc63180185ebf1793fab17748b2070ce6576
parent 2719fdbf22a155861fe0d6374bfb9da787dd0a19
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 3 Jul 2025 13:52:59 +0200
expose full_payto to AML officer (for #10147)
Diffstat:
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/exchange/taler-exchange-httpd_aml-decisions-get.c b/src/exchange/taler-exchange-httpd_aml-decisions-get.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2024 Taler Systems SA
+ Copyright (C) 2024, 2025 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -50,6 +50,7 @@
* @param to_investigate true if AML staff should look at the account
* @param is_active true if this is the currently active decision about the account
* @param is_wallet true if the @a h_payto is for a wallet
+ * @param payto the payto URI of the account affected by the decision
* @param account_rules current active rules for the account
*/
static void
@@ -64,6 +65,7 @@ record_cb (
bool to_investigate,
bool is_active,
bool is_wallet,
+ struct TALER_FullPayto payto,
const json_t *account_rules)
{
json_t *records = cls;
@@ -75,6 +77,8 @@ record_cb (
GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto ("h_payto",
h_payto),
+ TALER_JSON_pack_full_payto ("full_payto",
+ payto),
GNUNET_JSON_pack_bool ("is_wallet",
is_wallet),
GNUNET_JSON_pack_int64 ("rowid",
diff --git a/src/exchangedb/pg_select_aml_decisions.c b/src/exchangedb/pg_select_aml_decisions.c
@@ -81,6 +81,7 @@ handle_aml_result (void *cls,
bool to_investigate;
bool is_active;
json_t *account_rules;
+ struct TALER_FullPayto payto;
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_uint64 ("outcome_serial_id",
&rowid),
@@ -106,6 +107,8 @@ handle_aml_result (void *cls,
&to_investigate),
GNUNET_PQ_result_spec_bool ("is_active",
&is_active),
+ GNUNET_PQ_result_spec_string ("payto_uri",
+ &payto.full_payto),
GNUNET_PQ_result_spec_end
};
@@ -136,6 +139,7 @@ handle_aml_result (void *cls,
to_investigate,
is_active,
is_wallet,
+ payto,
account_rules);
GNUNET_PQ_cleanup_result (rs);
}
@@ -196,9 +200,12 @@ TEH_PG_select_aml_decisions (
",lo.is_active"
",lo.jnew_rules"
",kt.is_wallet"
+ ",wt.payto_uri"
" FROM legitimization_outcomes lo"
" JOIN kyc_targets kt"
" ON (lo.h_payto = kt.h_normalized_payto)"
+ " JOIN wire_targets wt"
+ " ON (lo.h_payto = wt.h_normalized_payto)"
" LEFT JOIN aml_history ah"
" USING (outcome_serial_id)"
" WHERE (outcome_serial_id > $7)"
diff --git a/src/include/taler/taler_exchangedb_plugin.h b/src/include/taler/taler_exchangedb_plugin.h
@@ -3847,6 +3847,7 @@ typedef void
* @param to_investigate true if AML staff should look at the account
* @param is_active true if this is the currently active decision about the account
* @param is_wallet true if the @a h_payto is for a Taler wallet
+ * @param payto payto URI of the account the decision is about
* @param account_rules current active rules for the account
*/
typedef void
@@ -3861,6 +3862,7 @@ typedef void
bool to_investigate,
bool is_active,
bool is_wallet,
+ struct TALER_FullPayto payto,
const json_t *account_rules);