exchange

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

iterate_aml_staff_above_serial_id.h (3200B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2026 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/iterate_aml_staff_above_serial_id.h
     18  * @brief implementation of the iterate_aml_staff_above_serial_id function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_ITERATE_AML_STAFF_ABOVE_SERIAL_ID_H
     22 #define EXCHANGE_DATABASE_ITERATE_AML_STAFF_ABOVE_SERIAL_ID_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "exchangedb_lib.h"
     27 
     28 
     29 #ifndef TALER_EXCHANGEDB_AML_STAFF_RESULT_CLOSURE
     30 /**
     31  * Type of the closure for #TALER_EXCHANGEDB_AmlStaffCallback.
     32  */
     33 #define TALER_EXCHANGEDB_AML_STAFF_RESULT_CLOSURE void
     34 #endif
     35 
     36 /* Callback typedefs */
     37 /**
     38  * Function called with a status change of an AML staff member.
     39  *
     40  * @param cls closure
     41  * @param rowid unique serial ID of the entry in aml_staff
     42  * @param decider_pub public key of the staff member
     43  * @param master_sig signature by the exchange's offline master key
     44  *        affirming this status, of purpose #TALER_SIGNATURE_MASTER_AML_KEY
     45  * @param decider_name legal name of the staff member
     46  * @param is_active true if the staff member could act from @a last_change on
     47  * @param read_only true if the staff member had read-only access
     48  * @param last_change when the status took effect, as claimed by the exchange
     49  * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
     50  */
     51 typedef enum GNUNET_GenericReturnValue
     52 (*TALER_EXCHANGEDB_AmlStaffCallback)(
     53   TALER_EXCHANGEDB_AML_STAFF_RESULT_CLOSURE *cls,
     54   uint64_t rowid,
     55   const struct TALER_AmlOfficerPublicKeyP *decider_pub,
     56   const struct TALER_MasterSignatureP *master_sig,
     57   const char *decider_name,
     58   bool is_active,
     59   bool read_only,
     60   struct GNUNET_TIME_Timestamp last_change);
     61 
     62 
     63 /**
     64  * Select AML staff status changes with a serial ID of at least @a serial_id,
     65  * in the order in which the exchange recorded them.
     66  *
     67  * `aml_staff` is append-only: a status change is a new row, so a caller can
     68  * resume from where it stopped and will still see every change.  The rows an
     69  * officer accumulates are that officer's history, oldest first.
     70  *
     71  * @param pg the database context
     72  * @param serial_id lowest serial ID to include
     73  * @param cb function to call on each result
     74  * @param cb_cls closure for @a cb
     75  * @return transaction status code
     76  */
     77 enum GNUNET_DB_QueryStatus
     78 TALER_EXCHANGEDB_iterate_aml_staff_above_serial_id (
     79   struct TALER_EXCHANGEDB_PostgresContext *pg,
     80   uint64_t serial_id,
     81   TALER_EXCHANGEDB_AmlStaffCallback cb,
     82   TALER_EXCHANGEDB_AML_STAFF_RESULT_CLOSURE *cb_cls);
     83 
     84 #endif