get_aggregation_deferral_by_wtid.h (2420B)
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/get_aggregation_deferral_by_wtid.h 18 * @brief implementation of the get_aggregation_deferral_by_wtid function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_GET_AGGREGATION_DEFERRAL_BY_WTID_H 22 #define EXCHANGE_DATABASE_GET_AGGREGATION_DEFERRAL_BY_WTID_H 23 24 #include "taler/taler_util.h" 25 #include "exchangedb_lib.h" 26 27 /** 28 * Obtain the exchange's most recent statement of why it has not executed the 29 * wire transfer @a wtid. Used by the auditor, which reads this out of its 30 * replica; `aggregation_deferrals` is append-only, so the row with the 31 * greatest serial ID is the claim in force. 32 * 33 * Returns #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the exchange never said 34 * anything about @a wtid, which for a transfer that is still pending means 35 * the exchange is simply not paying. 36 * 37 * Primary test table: `aggregation_deferrals` (see test_aggregation_deferrals.c). 38 * 39 * @param pg the database context 40 * @param wtid wire transfer to look up 41 * @param[out] amount set to the amount the exchange said it was withholding 42 * @param[out] reason set to the reason the exchange gave 43 * @param[out] kyc_requirement_row set to the legitimization measure the 44 * exchange named, or 0 if it named none 45 * @param[out] deferral_time set to when the exchange made the decision 46 * @return transaction status 47 */ 48 enum GNUNET_DB_QueryStatus 49 TALER_EXCHANGEDB_get_aggregation_deferral_by_wtid ( 50 struct TALER_EXCHANGEDB_PostgresContext *pg, 51 const struct TALER_WireTransferIdentifierRawP *wtid, 52 struct TALER_Amount *amount, 53 enum TALER_EXCHANGEDB_DeferralReason *reason, 54 uint64_t *kyc_requirement_row, 55 struct GNUNET_TIME_Timestamp *deferral_time); 56 57 #endif