exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit c73261c3e071801f42c8d0a0d291a68524286990
parent 83fbd9e472b787e3a2ae5b5e8c88eac73865a243
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue,  7 Apr 2026 11:31:54 +0200

allow setting operation_type as part of MeasureInformation as per spec

Diffstat:
Msrc/include/taler/taler-exchange/common.h | 29-----------------------------
Msrc/include/taler/taler-exchange/post-aml-OFFICER_PUB-decision.h | 35+++++++++++++++++++++++++++++++++++
Msrc/lib/exchange_api_post-aml-OFFICER_PUB-decision.c | 3+++
Msrc/testing/testing_api_cmd_take_aml_decision.c | 4++++
4 files changed, 42 insertions(+), 29 deletions(-)

diff --git a/src/include/taler/taler-exchange/common.h b/src/include/taler/taler-exchange/common.h @@ -157,33 +157,4 @@ struct TALER_EXCHANGE_PurseDeposit }; -/** - * Information about a (custom) measure. - */ -struct TALER_EXCHANGE_MeasureInformation -{ - /** - * Name of the measure. - */ - const char *measure_name; - - /** - * Name of the check. - */ - const char *check_name; - - /** - * Name of the AML program, can be NULL if @e check_name - * is for a check of type "INFO". - */ - const char *prog_name; - - /** - * Context for the check, can be NULL. - */ - const json_t *context; - -}; - - #endif diff --git a/src/include/taler/taler-exchange/post-aml-OFFICER_PUB-decision.h b/src/include/taler/taler-exchange/post-aml-OFFICER_PUB-decision.h @@ -25,6 +25,41 @@ /** + * Information about a (custom) measure. + */ +struct TALER_EXCHANGE_MeasureInformation +{ + /** + * Name of the measure. + */ + const char *measure_name; + + /** + * Name of the check. + */ + const char *check_name; + + /** + * Name of the AML program, can be NULL if @e check_name + * is for a check of type "INFO". + */ + const char *prog_name; + + /** + * Context for the check, can be NULL. + */ + const json_t *context; + + /** + * Operation type this measure relates to, + * can be #TALER_KYCLOGIC_KYC_TRIGGER_NONE if unknown. + */ + enum TALER_KYCLOGIC_KycTriggerEvent operation_type; + +}; + + +/** * Rule that applies for an account, specifies the * trigger and measures to apply. */ diff --git a/src/lib/exchange_api_post-aml-OFFICER_PUB-decision.c b/src/lib/exchange_api_post-aml-OFFICER_PUB-decision.c @@ -275,6 +275,9 @@ build_new_rules ( GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_string ("prog_name", mi->prog_name)), + /* We pack "NONE" for unknown, NULL would also be OK in that case. */ + TALER_JSON_pack_kycte ("operation_type", + mi->operation_type), GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_object_incref ("context", (json_t *) mi->context)) diff --git a/src/testing/testing_api_cmd_take_aml_decision.c b/src/testing/testing_api_cmd_take_aml_decision.c @@ -337,6 +337,10 @@ take_aml_decision_run (void *cls, GNUNET_JSON_spec_object_const ("context", &mi->context), NULL), + GNUNET_JSON_spec_mark_optional ( + TALER_JSON_spec_kycte ("operation_type", + &mi->operation_type), + NULL), GNUNET_JSON_spec_end () }; const char *err_name;