exchange

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

select_aml_measures.h (3558B)


      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/select_aml_measures.h
     18  * @brief implementation of the select_aml_measures function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_SELECT_AML_MEASURES_H
     22 #define EXCHANGE_DATABASE_SELECT_AML_MEASURES_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 legitimization measures.
     31  *
     32  * @param cls closure
     33  * @param h_payto hash of account the measure applies to
     34  * @param start_time when was the process started
     35  * @param jmeasures object of type ``LegitimizationMeasures``
     36  * @param is_finished true if the measure was finished
     37  * @param measure_serial_id row ID of the measure in the exchange table
     38  */
     39 typedef void
     40 (*TALER_EXCHANGEDB_LegitimizationMeasureCallback) (
     41   void *cls,
     42   struct TALER_NormalizedPaytoHashP *h_payto,
     43   struct GNUNET_TIME_Absolute start_time,
     44   const json_t *jmeasures,
     45   bool is_finished,
     46   uint64_t measure_serial_id);
     47 
     48 
     49 /* Callback typedefs */
     50 /**
     51  * Function called with legitimization measures.
     52  *
     53  * @param cls closure
     54  * @param h_payto hash of account the measure applies to
     55  * @param start_time when was the process started
     56  * @param jmeasures object of type ``LegitimizationMeasures``
     57  * @param is_finished true if the measure was finished
     58  * @param measure_serial_id row ID of the measure in the exchange table
     59  */
     60 typedef void
     61 (*TALER_EXCHANGEDB_LegitimizationMeasureCallback) (
     62   void *cls,
     63   struct TALER_NormalizedPaytoHashP *h_payto,
     64   struct GNUNET_TIME_Absolute start_time,
     65   const json_t *jmeasures,
     66   bool is_finished,
     67   uint64_t measure_serial_id);
     68 
     69 /**
     70  * Lookup legitimization measures.
     71  *
     72  * @param pg the database context
     73  * @param h_payto account for which the attribute data is stored,
     74  *                NULL to select for all accounts
     75  * @param active_only select only measures that are active
     76  * @param offset row offset to select from
     77  * @param limit number of results to return, negative to
     78  *               return in descending order from @a offset
     79  * @param cb callback to invoke on each match
     80  * @param cb_cls closure for @a cb
     81  * @return database transaction status
     82  */
     83 enum GNUNET_DB_QueryStatus
     84 TALER_EXCHANGEDB_select_aml_measures (struct TALER_EXCHANGEDB_PostgresContext *
     85                                       pg,
     86                                       const struct TALER_NormalizedPaytoHashP *
     87                                       h_payto
     88                                       ,
     89                                       enum TALER_EXCHANGE_YesNoAll active_only,
     90                                       uint64_t offset,
     91                                       int64_t limit,
     92                                       TALER_EXCHANGEDB_LegitimizationMeasureCallback
     93                                       cb,
     94                                       void *cb_cls);
     95 
     96 #endif