insert_aggregation_deferral.h (2594B)
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/insert_aggregation_deferral.h 18 * @brief implementation of the insert_aggregation_deferral function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_INSERT_AGGREGATION_DEFERRAL_H 22 #define EXCHANGE_DATABASE_INSERT_AGGREGATION_DEFERRAL_H 23 24 #include "taler/taler_util.h" 25 #include "exchangedb_lib.h" 26 27 /** 28 * Record why the aggregator did not execute the wire transfer @a wtid that it 29 * had already decided on. Appends to `aggregation_deferrals`, which unlike 30 * `aggregation_transient` is replicated to the auditor, so that an external 31 * auditor sees the exchange's own account of what it is withholding and why 32 * instead of having to infer it. 33 * 34 * The row is tied to the deposit of the aggregate that is last to reach its 35 * wire deadline, so that garbage collecting the deposits also removes this 36 * claim about them. It is therefore an error to call this before the 37 * `aggregation_tracking` rows for @a wtid have been written; the statement 38 * inserts nothing in that case. 39 * 40 * @param pg the database context 41 * @param wtid the wire transfer that was not executed 42 * @param h_payto destination that was not paid 43 * @param amount total that was withheld 44 * @param reason why the transfer was not made 45 * @param kyc_requirement_row legitimization measure that has to be satisfied 46 * first, or 0 if @a reason is not #TALER_EXCHANGEDB_DR_KYC 47 * @param deferral_time when the decision was made 48 * @return transaction status 49 */ 50 enum GNUNET_DB_QueryStatus 51 TALER_EXCHANGEDB_insert_aggregation_deferral ( 52 struct TALER_EXCHANGEDB_PostgresContext *pg, 53 const struct TALER_WireTransferIdentifierRawP *wtid, 54 const struct TALER_FullPaytoHashP *h_payto, 55 const struct TALER_Amount *amount, 56 enum TALER_EXCHANGEDB_DeferralReason reason, 57 uint64_t kyc_requirement_row, 58 struct GNUNET_TIME_Timestamp deferral_time); 59 60 #endif