lookup_aml_history.h (3768B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2024 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 src/include/exchange-database/lookup_aml_history.h 18 * @brief implementation of the lookup_aml_history function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_LOOKUP_AML_HISTORY_H 22 #define EXCHANGE_DATABASE_LOOKUP_AML_HISTORY_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /** 30 * Function called with historic AML events of an 31 * account. 32 * 33 * @param cls closure 34 * @param outcome_serial_id row ID of the decision 35 * @param decision_time when was the decision taken 36 * @param justification what was the given justification 37 * @param decider_pub which key signed the decision 38 * @param jproperties what are the new account properties 39 * @param jnew_rules what are the new account rules 40 * @param to_investigate should AML staff investigate 41 * after the decision 42 * @param is_active is this the active decision 43 */ 44 typedef void 45 (*TALER_EXCHANGEDB_AmlHistoryCallback) ( 46 void *cls, 47 uint64_t outcome_serial_id, 48 struct GNUNET_TIME_Timestamp decision_time, 49 const char *justification, 50 const struct TALER_AmlOfficerPublicKeyP *decider_pub, 51 const json_t *jproperties, 52 const json_t *jnew_rules, 53 bool to_investigate, 54 bool is_active); 55 56 57 /* Callback typedefs */ 58 /** 59 * Function called with historic AML events of an 60 * account. 61 * 62 * @param cls closure 63 * @param outcome_serial_id row ID of the decision 64 * @param decision_time when was the decision taken 65 * @param justification what was the given justification 66 * @param decider_pub which key signed the decision 67 * @param jproperties what are the new account properties 68 * @param jnew_rules what are the new account rules 69 * @param to_investigate should AML staff investigate 70 * after the decision 71 * @param is_active is this the active decision 72 */ 73 typedef void 74 (*TALER_EXCHANGEDB_AmlHistoryCallback) ( 75 void *cls, 76 uint64_t outcome_serial_id, 77 struct GNUNET_TIME_Timestamp decision_time, 78 const char *justification, 79 const struct TALER_AmlOfficerPublicKeyP *decider_pub, 80 const json_t *jproperties, 81 const json_t *jnew_rules, 82 bool to_investigate, 83 bool is_active); 84 85 /** 86 * Lookup AML history for an account identified via 87 * @a h_payto. 88 * 89 * @param pg the database context 90 * @param h_payto hash of account to lookup history for 91 * @param offset row ID to start returning results from 92 * @param limit how many results to return, negative for descending order 93 * @param cb function to call on results 94 * @param cb_cls closure for @a cb 95 * @return database transaction status 96 */ 97 enum GNUNET_DB_QueryStatus 98 TALER_EXCHANGEDB_lookup_aml_history (struct TALER_EXCHANGEDB_PostgresContext *pg 99 , 100 const struct TALER_NormalizedPaytoHashP * 101 h_payto, 102 uint64_t offset, 103 int64_t limit, 104 TALER_EXCHANGEDB_AmlHistoryCallback cb, 105 void *cb_cls); 106 107 108 #endif