account_history.h (2696B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2022 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 account_history.h 18 * @brief implementation of the account_history function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_ACCOUNT_HISTORY_H 22 #define EXCHANGE_DATABASE_ACCOUNT_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 * Closure for various history building functions. 31 */ 32 struct TALER_EXCHANGEDB_HistoryBuilderContext 33 { 34 /** 35 * Account to build history for. 36 */ 37 const struct TALER_NormalizedPaytoHashP *account; 38 39 /** 40 * Database context to build history with. 41 */ 42 struct TALER_EXCHANGEDB_PostgresContext *pg; 43 44 /** 45 * Key to use to decrypt KYC attributes. 46 */ 47 struct TALER_AttributeEncryptionKeyP *attribute_key; 48 49 /** 50 * True if @e account is for a wallet. 51 */ 52 bool is_wallet; 53 }; 54 55 56 /** 57 * Function called to obtain an AML 58 * history in JSON on-demand if needed. 59 * 60 * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *` 61 * @return AML history in JSON format, NULL on error 62 */ 63 json_t * 64 TALER_EXCHANGEDB_aml_history_builder (void *cls); 65 66 67 /** 68 * Function called to obtain a KYC 69 * history in JSON on-demand if needed. 70 * 71 * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *` 72 * @return KYC history in JSON format, NULL on error 73 */ 74 json_t * 75 TALER_EXCHANGEDB_kyc_history_builder (void *cls); 76 77 78 /** 79 * Function called to obtain the current ``LegitimizationRuleSet`` 80 * in JSON for an account on-demand if needed. 81 * 82 * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *` 83 * @return KYC history in JSON format, NULL on error 84 */ 85 json_t * 86 TALER_EXCHANGEDB_current_rule_builder (void *cls); 87 88 89 /** 90 * Function called to obtain the latest KYC attributes 91 * in JSON for an account on-demand if needed. 92 * 93 * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *` 94 * @return KYC attributes in JSON format, NULL on error 95 */ 96 json_t * 97 TALER_EXCHANGEDB_current_attributes_builder (void *cls); 98 99 100 #endif