iterate_unscreened_kyc_attributes.h (3135B)
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/iterate_unscreened_kyc_attributes.h 18 * @brief implementation of the iterate_unscreened_kyc_attributes function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_ITERATE_UNSCREENED_KYC_ATTRIBUTES_H 22 #define EXCHANGE_DATABASE_ITERATE_UNSCREENED_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 #ifndef TALER_EXCHANGEDB_UNSCREENED_ATTRIBUTES_RESULT_CLOSURE 30 /** 31 * Type of the closure for #TALER_EXCHANGEDB_UnscreenedAttributesCallback. 32 */ 33 #define TALER_EXCHANGEDB_UNSCREENED_ATTRIBUTES_RESULT_CLOSURE void 34 #endif 35 36 /** 37 * Return KYC attribute information. 38 * 39 * @param cls closure 40 * @param row_id current row in kyc_attributes table 41 * @param h_payto account the attributes are about 42 * @param provider_name name of the provider that collected the attributes 43 * @param collection_time when were the attributes collected 44 * @param expiration_time when does the data expire 45 * @param properties properties that were set for @a h_payto 46 * @param enc_attributes_size size of @a enc_attributes 47 * @param enc_attributes the encrypted collected attributes 48 * @return true to continue to iterate 49 */ 50 typedef bool 51 (*TALER_EXCHANGEDB_UnscreenedAttributesCallback)( 52 TALER_EXCHANGEDB_UNSCREENED_ATTRIBUTES_RESULT_CLOSURE *cls, 53 uint64_t row_id, 54 const struct TALER_NormalizedPaytoHashP *h_payto, 55 const char *provider_name, 56 struct GNUNET_TIME_Timestamp collection_time, 57 struct GNUNET_TIME_Timestamp expiration_time, 58 const json_t *properties, 59 size_t enc_attributes_size, 60 const void *enc_attributes); 61 62 63 /** 64 * Lookup all KYC attributes that have not yet been screened against the 65 * current sanctions list, in ascending row order. Rows are marked as 66 * screened with #TALER_EXCHANGEDB_update_to_kyc_attributes_screened(), and 67 * #TALER_EXCHANGEDB_update_to_kyc_attributes_unscreened() makes all rows 68 * show up here again. 69 * 70 * Primary test table: `kyc_attributes` (see test_kyc_attributes.c). 71 * 72 * @param pg the database context 73 * @param cb callback to invoke on each match 74 * @param cb_cls closure for @a cb 75 * @return database transaction status 76 */ 77 enum GNUNET_DB_QueryStatus 78 TALER_EXCHANGEDB_iterate_unscreened_kyc_attributes ( 79 struct TALER_EXCHANGEDB_PostgresContext *pg, 80 TALER_EXCHANGEDB_UnscreenedAttributesCallback cb, 81 TALER_EXCHANGEDB_UNSCREENED_ATTRIBUTES_RESULT_CLOSURE *cb_cls); 82 83 #endif