select_batch_deposits_missing_wire.h (3326B)
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/select_batch_deposits_missing_wire.h 18 * @brief implementation of the select_batch_deposits_missing_wire function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_SELECT_BATCH_DEPOSITS_MISSING_WIRE_H 22 #define EXCHANGE_DATABASE_SELECT_BATCH_DEPOSITS_MISSING_WIRE_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 on (batch) deposits will need a wire 31 * transfer. 32 * 33 * @param cls closure 34 * @param batch_deposit_serial_id where in the table are we 35 * @param total_amount value of all missing deposits, including fees 36 * @param wire_target_h_payto hash of the recipient account's payto URI 37 * @param deadline what was the earliest requested wire transfer deadline 38 */ 39 typedef void 40 (*TALER_EXCHANGEDB_WireMissingCallback)( 41 void *cls, 42 uint64_t batch_deposit_serial_id, 43 const struct TALER_Amount *total_amount, 44 const struct TALER_FullPaytoHashP *wire_target_h_payto, 45 struct GNUNET_TIME_Timestamp deadline); 46 47 48 /* Callback typedefs */ 49 /** 50 * Function called on (batch) deposits will need a wire 51 * transfer. 52 * 53 * @param cls closure 54 * @param batch_deposit_serial_id where in the table are we 55 * @param total_amount value of all missing deposits, including fees 56 * @param wire_target_h_payto hash of the recipient account's payto URI 57 * @param deadline what was the earliest requested wire transfer deadline 58 */ 59 typedef void 60 (*TALER_EXCHANGEDB_WireMissingCallback)( 61 void *cls, 62 uint64_t batch_deposit_serial_id, 63 const struct TALER_Amount *total_amount, 64 const struct TALER_FullPaytoHashP *wire_target_h_payto, 65 struct GNUNET_TIME_Timestamp deadline); 66 67 /** 68 * Select all of those batch deposits in the database 69 * above the given serial ID. 70 * 71 * @param pg the database context 72 * @param min_batch_deposit_serial_id select all batch deposits above this ID 73 * @param cb function to call on all such deposits 74 * @param cb_cls closure for @a cb 75 * @return transaction status code 76 */ 77 enum GNUNET_DB_QueryStatus 78 TALER_EXCHANGEDB_select_batch_deposits_missing_wire (struct 79 TALER_EXCHANGEDB_PostgresContext 80 *pg, 81 uint64_t 82 min_batch_deposit_serial_id, 83 TALER_EXCHANGEDB_WireMissingCallback 84 cb, 85 void *cb_cls); 86 87 #endif