exchange

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

insert_aml_decision.h (5314B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2022, 2023 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/insert_aml_decision.h
     18  * @brief implementation of the insert_aml_decision function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_INSERT_AML_DECISION_H
     22 #define EXCHANGE_DATABASE_INSERT_AML_DECISION_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "exchangedb_lib.h"
     27 
     28 
     29 /**
     30  * Insert an AML decision. Inserts into AML history and insert or updates AML
     31  * status.
     32  *
     33  * @param pg the database context
     34  * @param payto_uri full URI of the account, optional,
     35  *    can be NULL if the backend already knows the account
     36  * @param h_payto account for which the attribute data is stored
     37  * @param decision_time when was the decision made
     38  * @param expiration_time when does the decision expire
     39  * @param properties JSON object with properties to set for the account
     40  * @param new_rules JSON array with new AML/KYC rules
     41  * @param to_investigate true if AML staff should look more into this account
     42  * @param new_measure_name name of the @a jmeasures measure that was triggered, or NULL for none
     43  * @param jmeasures a JSON with LegitimizationMeasures to apply to the
     44  *    account, or NULL to not apply any measure right now
     45  * @param justification human-readable text justifying the decision
     46  * @param decider_pub public key of the staff member
     47  * @param decider_sig signature of the staff member
     48  * @param num_events length of the @a events array
     49  * @param events array of events to trigger
     50  * @param enc_attributes_size number of bytes in @a enc_attributes
     51  * @param enc_attributes encrypted attribute data
     52  * @param form_name name of the form from which @a enc_attributes originate, can be NULL
     53  * @param attributes_hash hash of the unencrypted attribute data
     54  * @param attributes_expiration_time when does the attribute data expire
     55  * @param[out] invalid_officer set to TRUE if @a decider_pub is not allowed to make decisions right now
     56  * @param[out] unknown_account set to TRUE if @a h_payto does not refer to a known account and @a jmeasures was given
     57  * @param[out] last_date set to the previous decision time;
     58  *   the INSERT is not performed if @a last_date is not before @a decision_time
     59  * @param[out] legitimization_measure_serial_id serial ID of the legitimization measures
     60  *   of the decision
     61  * @param[out] is_wallet set to true if @a h_payto is for a wallet
     62  * @return database transaction status
     63  */
     64 enum GNUNET_DB_QueryStatus
     65 TALER_EXCHANGEDB_insert_aml_decision (struct TALER_EXCHANGEDB_PostgresContext *
     66                                       pg,
     67                                       const struct TALER_FullPayto payto_uri,
     68                                       const struct TALER_NormalizedPaytoHashP *
     69                                       h_payto
     70                                       ,
     71                                       struct GNUNET_TIME_Timestamp decision_time
     72                                       ,
     73                                       struct GNUNET_TIME_Timestamp
     74                                       expiration_time,
     75                                       const json_t *properties,
     76                                       const json_t *new_rules,
     77                                       bool to_investigate,
     78                                       const char *new_measure_name,
     79                                       const json_t *jmeasures,
     80                                       const char *justification,
     81                                       const struct TALER_AmlOfficerPublicKeyP *
     82                                       decider_pub,
     83                                       const struct TALER_AmlOfficerSignatureP *
     84                                       decider_sig,
     85                                       size_t num_events,
     86                                       const char *events[static num_events],
     87                                       const char *form_name,
     88                                       size_t enc_attributes_size,
     89                                       const void *enc_attributes,
     90                                       struct GNUNET_HashCode *attributes_hash,
     91                                       struct GNUNET_TIME_Timestamp
     92                                       attributes_expiration_time,
     93                                       bool *invalid_officer,
     94                                       bool *unknown_account,
     95                                       struct GNUNET_TIME_Timestamp *last_date,
     96                                       uint64_t *legitimization_measure_serial_id
     97                                       ,
     98                                       bool *is_wallet);
     99 
    100 
    101 #endif