/*
  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/do_insert_recdoc_payment.h
 * @brief Anastasis database: insert recdoc payment
 * @author Christian Grothoff
 */
#ifndef ANASTASIS_DATABASE_DO_INSERT_RECDOC_PAYMENT_H
#define ANASTASIS_DATABASE_DO_INSERT_RECDOC_PAYMENT_H

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

/**
 * Store payment. Used to begin a payment, not indicative
 * that the payment actually was made. (That is done
 * when we increment the account's lifetime.)
 *
 * @param account_pub anastasis's public key
 * @param post_counter how many uploads does @a amount pay for
 * @param payment_secret payment secret which the user must provide with every upload
 * @param amount how much we asked for
 * @return transaction status
 */
enum GNUNET_DB_QueryStatus
ANASTASIS_DB_do_insert_recdoc_payment (
  const struct ANASTASIS_CRYPTO_AccountPublicKeyP *account_pub,
  uint32_t post_counter,
  const struct ANASTASIS_PaymentSecretP *payment_secret,
  const struct TALER_Amount *amount);

#endif
