pg_insert_aml_decision.h (4017B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2022, 2023 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file exchangedb/pg_insert_aml_decision.h 18 * @brief implementation of the insert_aml_decision function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef PG_INSERT_AML_DECISION_H 22 #define PG_INSERT_AML_DECISION_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "taler/taler_exchangedb_plugin.h" 27 28 29 /** 30 * Insert an AML decision. Inserts into AML history and insert or updates AML 31 * status. 32 * 33 * @param cls closure 34 * @param payto_uri full URI of the account, optional, 35 * can be NULL if the backend already knows the account 36 * @param h_payto account for which the attribute data is stored 37 * @param decision_time when was the decision made 38 * @param expiration_time when does the decision expire 39 * @param properties JSON object with properties to set for the account 40 * @param new_rules JSON array with new AML/KYC rules 41 * @param to_investigate true if AML staff should look more into this account 42 * @param new_measure_name name of the @a jmeasures measure that was triggered, or NULL for none 43 * @param jmeasures a JSON with LegitimizationMeasures to apply to the 44 * account, or NULL to not apply any measure right now 45 * @param justification human-readable text justifying the decision 46 * @param decider_pub public key of the staff member 47 * @param decider_sig signature of the staff member 48 * @param num_events length of the @a events array 49 * @param events array of events to trigger 50 * @param enc_attributes_size number of bytes in @a enc_attributes 51 * @param enc_attributes encrypted attribute data 52 * @param form_name name of the form from which @a enc_attributes originate, can be NULL 53 * @param attributes_hash hash of the unencrypted attribute data 54 * @param attributes_expiration_time when does the attribute data expire 55 * @param[out] invalid_officer set to TRUE if @a decider_pub is not allowed to make decisions right now 56 * @param[out] unknown_account set to TRUE if @a h_payto does not refer to a known account and @a jmeasures was given 57 * @param[out] last_date set to the previous decision time; 58 * the INSERT is not performed if @a last_date is not before @a decision_time 59 * @param[out] legitimization_measure_serial_id serial ID of the legitimization measures 60 * of the decision 61 * @param[out] is_wallet set to true if @a h_payto is for a wallet 62 * @return database transaction status 63 */ 64 enum GNUNET_DB_QueryStatus 65 TEH_PG_insert_aml_decision ( 66 void *cls, 67 const struct TALER_FullPayto payto_uri, 68 const struct TALER_NormalizedPaytoHashP *h_payto, 69 struct GNUNET_TIME_Timestamp decision_time, 70 struct GNUNET_TIME_Timestamp expiration_time, 71 const json_t *properties, 72 const json_t *new_rules, 73 bool to_investigate, 74 const char *new_measure_name, 75 const json_t *jmeasures, 76 const char *justification, 77 const struct TALER_AmlOfficerPublicKeyP *decider_pub, 78 const struct TALER_AmlOfficerSignatureP *decider_sig, 79 size_t num_events, 80 const char *events[static num_events], 81 const char *form_name, 82 size_t enc_attributes_size, 83 const void *enc_attributes, 84 struct GNUNET_HashCode *attributes_hash, 85 struct GNUNET_TIME_Timestamp attributes_expiration_time, 86 bool *invalid_officer, 87 bool *unknown_account, 88 struct GNUNET_TIME_Timestamp *last_date, 89 uint64_t *legitimization_measure_serial_id, 90 bool *is_wallet); 91 92 93 #endif