/*
  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_gc.h
 * @brief garbage collection for the Anastasis database
 * @author Christian Grothoff
 */
#ifndef ANASTASIS_DATABASE_DO_GC_H
#define ANASTASIS_DATABASE_DO_GC_H

#include <gnunet/gnunet_util_lib.h>
#include <gnunet/gnunet_db_lib.h>

/**
 * Function called to perform "garbage collection" on the
 * database, expiring records we no longer require.  Deletes
 * all user records that are not paid up (and by cascade deletes
 * the associated recovery documents). Also deletes expired
 * truth and financial records older than @a expire_pending_payments.
 *
 * @param expire_backups backups older than the given time stamp should be garbage collected
 * @param expire_pending_payments payments still pending from since before
 *            this value should be garbage collected
 * @return transaction status
 */
enum GNUNET_DB_QueryStatus
ANASTASIS_DB_do_gc (struct GNUNET_TIME_Absolute expire_backups,
                    struct GNUNET_TIME_Absolute expire_pending_payments);

#endif
