exchange

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

account_history.h (2996B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2022 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 account_history.h
     18  * @brief implementation of the account_history function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_ACCOUNT_HISTORY_H
     22 #define EXCHANGE_DATABASE_ACCOUNT_HISTORY_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "exchangedb_lib.h"
     27 
     28 
     29 /**
     30  * Closure for various history building functions.
     31  */
     32 struct TALER_EXCHANGEDB_HistoryBuilderContext
     33 {
     34   /**
     35    * Account to build history for.
     36    */
     37   const struct TALER_NormalizedPaytoHashP *account;
     38 
     39   /**
     40    * Database context to build history with.
     41    */
     42   struct TALER_EXCHANGEDB_PostgresContext *pg;
     43 
     44   /**
     45    * Key to use to decrypt KYC attributes.
     46    */
     47   struct TALER_AttributeEncryptionKeyP *attribute_key;
     48 
     49   /**
     50    * True if @e account is for a wallet.
     51    */
     52   bool is_wallet;
     53 };
     54 
     55 
     56 /**
     57  * Function called to obtain an AML
     58  * history in JSON on-demand if needed.
     59  *
     60  * Primary test table: `aml_history` (see test_aml_history.c).
     61  *
     62  * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *`
     63  * @return AML history in JSON format, NULL on error
     64  */
     65 json_t *
     66 TALER_EXCHANGEDB_aml_history_builder (void *cls);
     67 
     68 
     69 /**
     70  * Function called to obtain a KYC
     71  * history in JSON on-demand if needed.
     72  *
     73  * Primary test table: `kyc_attributes` (see test_kyc_attributes.c).
     74  *
     75  * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *`
     76  * @return KYC history in JSON format, NULL on error
     77  */
     78 json_t *
     79 TALER_EXCHANGEDB_kyc_history_builder (void *cls);
     80 
     81 
     82 /**
     83  * Function called to obtain the current ``LegitimizationRuleSet``
     84  * in JSON for an account on-demand if needed.
     85  *
     86  * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c).
     87  *
     88  * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *`
     89  * @return KYC history in JSON format, NULL on error
     90  */
     91 json_t *
     92 TALER_EXCHANGEDB_current_rule_builder (void *cls);
     93 
     94 
     95 /**
     96  * Function called to obtain the latest KYC attributes
     97  * in JSON for an account on-demand if needed.
     98  *
     99  * Primary test table: `kyc_attributes` (see test_kyc_attributes.c).
    100  *
    101  * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *`
    102  * @return KYC attributes in JSON format, NULL on error
    103  */
    104 json_t *
    105 TALER_EXCHANGEDB_current_attributes_builder (void *cls);
    106 
    107 
    108 #endif