exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

select_all_kyc_attributes.h (4086B)


      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 #ifndef TALER_EXCHANGEDB_ALL_ATTRIBUTES_RESULT_CLOSURE
     44 /**
     45  * Type of the closure for #TALER_EXCHANGEDB_AllAttributesCallback.
     46  */
     47 #define TALER_EXCHANGEDB_ALL_ATTRIBUTES_RESULT_CLOSURE void
     48 #endif
     49 typedef bool
     50 (*TALER_EXCHANGEDB_AllAttributesCallback)(
     51   TALER_EXCHANGEDB_ALL_ATTRIBUTES_RESULT_CLOSURE *cls,
     52   uint64_t row_id,
     53   const struct TALER_NormalizedPaytoHashP *h_payto,
     54   const char *provider_name,
     55   struct GNUNET_TIME_Timestamp collection_time,
     56   struct GNUNET_TIME_Timestamp expiration_time,
     57   const json_t *properties,
     58   size_t enc_attributes_size,
     59   const void *enc_attributes);
     60 
     61 
     62 /* Callback typedefs */
     63 /**
     64  * Return KYC attribute information.
     65  *
     66  * @param cls closure
     67  * @param row_id current row in kyc_attributes table
     68  * @param h_payto account the attributes are about
     69  * @param provider_name name of the provider that collected the attributes
     70  * @param collection_time when were the attributes collected
     71  * @param expiration_time when does the data expire
     72  * @param properties properties that were set for @a h_payto
     73  * @param enc_attributes_size size of @a enc_attributes
     74  * @param enc_attributes the encrypted collected attributes
     75  * @return true to continue to iterate
     76  */
     77 typedef bool
     78 (*TALER_EXCHANGEDB_AllAttributesCallback)(
     79   TALER_EXCHANGEDB_ALL_ATTRIBUTES_RESULT_CLOSURE *cls,
     80   uint64_t row_id,
     81   const struct TALER_NormalizedPaytoHashP *h_payto,
     82   const char *provider_name,
     83   struct GNUNET_TIME_Timestamp collection_time,
     84   struct GNUNET_TIME_Timestamp expiration_time,
     85   const json_t *properties,
     86   size_t enc_attributes_size,
     87   const void *enc_attributes);
     88 
     89 /**
     90  * Lookup all KYC attributes above @a min_row_id.
     91  *
     92  * @param pg the database context
     93  * @param min_row_id minimum row ID to return (exclusive)
     94  * @param cb callback to invoke on each match
     95  * @param cb_cls closure for @a cb
     96  * @return database transaction status
     97  */
     98 enum GNUNET_DB_QueryStatus
     99 TALER_EXCHANGEDB_select_all_kyc_attributes (struct
    100                                             TALER_EXCHANGEDB_PostgresContext *pg
    101                                             ,
    102                                             uint64_t min_row_id,
    103                                             TALER_EXCHANGEDB_AllAttributesCallback
    104                                             cb,
    105                                             TALER_EXCHANGEDB_ALL_ATTRIBUTES_RESULT_CLOSURE
    106                                             *cb_cls);
    107 
    108 #endif