exchange

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

select_pending_deposits.h (3778B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 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/auditor-database/select_pending_deposits.h
     18  * @brief implementation of the select_pending_deposits function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef AUDITOR_DATABASE_SELECT_PENDING_DEPOSITS_H
     22 #define AUDITOR_DATABASE_SELECT_PENDING_DEPOSITS_H
     23 
     24 #include "taler/taler_util.h"
     25 #include "taler/taler_json_lib.h"
     26 #include "auditordb_lib.h"
     27 
     28 
     29 /**
     30  * Function called on deposits that are past their due date
     31  * and have not yet seen a wire transfer.
     32  *
     33  * @param cls closure
     34  * @param row_id row ID of the alert in the auditor database
     35  * @param batch_deposit_serial_id where in the exchange table are we
     36  * @param total_amount value of all missing deposits, including fees
     37  * @param wire_target_h_payto hash of the recipient account's payto URI
     38  * @param deadline what was the earliest requested wire transfer deadline
     39  * @param suppressed true if this report was suppressed
     40  */
     41 typedef void
     42 (*TALER_AUDITORDB_WireMissingCallback) (
     43   void *cls,
     44   uint64_t row_id,
     45   uint64_t batch_deposit_serial_id,
     46   const struct TALER_Amount *total_amount,
     47   const struct TALER_FullPaytoHashP *wire_target_h_payto,
     48   struct GNUNET_TIME_Timestamp deadline,
     49   bool suppressed);
     50 
     51 
     52 /* Callback typedefs */
     53 /**
     54  * Function called on deposits that are past their due date
     55  * and have not yet seen a wire transfer.
     56  *
     57  * @param cls closure
     58  * @param row_id row ID of the alert in the auditor database
     59  * @param batch_deposit_serial_id where in the exchange table are we
     60  * @param total_amount value of all missing deposits, including fees
     61  * @param wire_target_h_payto hash of the recipient account's payto URI
     62  * @param deadline what was the earliest requested wire transfer deadline
     63  * @param suppressed true if this report was suppressed
     64  */
     65 typedef void
     66 (*TALER_AUDITORDB_WireMissingCallback) (
     67   void *cls,
     68   uint64_t row_id,
     69   uint64_t batch_deposit_serial_id,
     70   const struct TALER_Amount *total_amount,
     71   const struct TALER_FullPaytoHashP *wire_target_h_payto,
     72   struct GNUNET_TIME_Timestamp deadline,
     73   bool suppressed);
     74 
     75 /**
     76  * Return (batch) deposits for which we have not yet
     77  * seen the required wire transfer.
     78  *
     79  * @param pg the database context
     80  * @param deadline only return up to this deadline
     81  * @param limit number of rows to return, negative to iterate backwards
     82  * @param offset starting offset, exclusive
     83  * @param return_suppressed true to also return suppressed events
     84  * @param cb function to call on each entry
     85  * @param cb_cls closure for @a cb
     86  * @return transaction status code
     87  */
     88 enum GNUNET_DB_QueryStatus
     89 TALER_AUDITORDB_select_pending_deposits (struct
     90                                          TALER_AUDITORDB_PostgresContext *pg,
     91                                          struct GNUNET_TIME_Absolute deadline,
     92                                          int64_t limit,
     93                                          uint64_t offset,
     94                                          bool return_suppressed,
     95                                          TALER_AUDITORDB_WireMissingCallback cb,
     96                                          void *cb_cls);
     97 
     98 #endif