/*
  This file is part of Anastasis
  Copyright (C) 2020-2022 Anastasis SARL

  Anastasis is free software; you can redistribute it and/or modify it under the
  terms of the GNU Affero General Public License as published by the Free Software
  Foundation; either version 3, or (at your option) any later version.

  Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License along with
  Anastasis; see the file COPYING.GPL.  If not, see <http://www.gnu.org/licenses/>
*/
/**
 * @file include/anastasis/anastasis-database/iterate_auth_iban_transfers.h
 * @brief Anastasis database: iterate auth iban transfers
 * @author Christian Grothoff
 */
#ifndef ANASTASIS_DATABASE_ITERATE_AUTH_IBAN_TRANSFERS_H
#define ANASTASIS_DATABASE_ITERATE_AUTH_IBAN_TRANSFERS_H

#include <gnunet/gnunet_util_lib.h>
#include <gnunet/gnunet_db_lib.h>
#include "anastasis_service.h"
#include "anastasis/anastasis-database/common.h"

/**
 * Function to check if we are aware of a wire transfer
 * that satisfies the IBAN plugin's authentication check.
 *
 * @param debit_account which debit account to check
 * @param earliest_date earliest date to check
 * @param cb function to call on all entries found
 * @param cb_cls closure for @a cb
 * @return transaction status,
 *    #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT if @a cb
 *      returned 'true' once
 *    #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if no
 *      wire transfers existed for which @a cb returned true
 */
enum GNUNET_DB_QueryStatus
ANASTASIS_DB_iterate_auth_iban_transfers (
  const char *debit_account,
  struct GNUNET_TIME_Timestamp earliest_date,
  ANASTASIS_DB_AuthIbanTransferCallback cb,
  void *cb_cls);

#endif
