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 (3968B)


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