select_all_kyc_attributes.h (3718B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2025 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/select_all_kyc_attributes.h 18 * @brief implementation of the select_all_kyc_attributes function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_SELECT_ALL_KYC_ATTRIBUTES_H 22 #define EXCHANGE_DATABASE_SELECT_ALL_KYC_ATTRIBUTES_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /** 30 * Return KYC attribute information. 31 * 32 * @param cls closure 33 * @param row_id current row in kyc_attributes table 34 * @param h_payto account the attributes are about 35 * @param provider_name name of the provider that collected the attributes 36 * @param collection_time when were the attributes collected 37 * @param expiration_time when does the data expire 38 * @param properties properties that were set for @a h_payto 39 * @param enc_attributes_size size of @a enc_attributes 40 * @param enc_attributes the encrypted collected attributes 41 * @return true to continue to iterate 42 */ 43 typedef bool 44 (*TALER_EXCHANGEDB_AllAttributesCallback)( 45 void *cls, 46 uint64_t row_id, 47 const struct TALER_NormalizedPaytoHashP *h_payto, 48 const char *provider_name, 49 struct GNUNET_TIME_Timestamp collection_time, 50 struct GNUNET_TIME_Timestamp expiration_time, 51 const json_t *properties, 52 size_t enc_attributes_size, 53 const void *enc_attributes); 54 55 56 /* Callback typedefs */ 57 /** 58 * Return KYC attribute information. 59 * 60 * @param cls closure 61 * @param row_id current row in kyc_attributes table 62 * @param h_payto account the attributes are about 63 * @param provider_name name of the provider that collected the attributes 64 * @param collection_time when were the attributes collected 65 * @param expiration_time when does the data expire 66 * @param properties properties that were set for @a h_payto 67 * @param enc_attributes_size size of @a enc_attributes 68 * @param enc_attributes the encrypted collected attributes 69 * @return true to continue to iterate 70 */ 71 typedef bool 72 (*TALER_EXCHANGEDB_AllAttributesCallback)( 73 void *cls, 74 uint64_t row_id, 75 const struct TALER_NormalizedPaytoHashP *h_payto, 76 const char *provider_name, 77 struct GNUNET_TIME_Timestamp collection_time, 78 struct GNUNET_TIME_Timestamp expiration_time, 79 const json_t *properties, 80 size_t enc_attributes_size, 81 const void *enc_attributes); 82 83 /** 84 * Lookup all KYC attributes above @a min_row_id. 85 * 86 * @param pg the database context 87 * @param min_row_id minimum row ID to return (exclusive) 88 * @param cb callback to invoke on each match 89 * @param cb_cls closure for @a cb 90 * @return database transaction status 91 */ 92 enum GNUNET_DB_QueryStatus 93 TALER_EXCHANGEDB_select_all_kyc_attributes (struct 94 TALER_EXCHANGEDB_PostgresContext *pg 95 , 96 uint64_t min_row_id, 97 TALER_EXCHANGEDB_AllAttributesCallback 98 cb, 99 void *cb_cls); 100 101 #endif