/*
   This file is part of TALER
   Copyright (C) 2026 Taler Systems SA

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

   TALER 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 General Public License for more details.

   You should have received a copy of the GNU General Public License along with
   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 */
/**
 * @file src/include/auditor-database/insert_aml_staff.h
 * @brief implementation of the insert_aml_staff function for Postgres
 * @author Christian Grothoff
 */
#ifndef AUDITOR_DATABASE_INSERT_AML_STAFF_H
#define AUDITOR_DATABASE_INSERT_AML_STAFF_H

#include "auditordb_lib.h"


/**
 * Remember an AML staff status change we observed at the exchange.
 *
 * Does nothing if we already recorded this (@a decider_pub, @a last_change)
 * pair, which is the normal case: the exchange keeps showing us the current
 * status of every staff member on every round.
 *
 * @param pg the database context
 * @param decider_pub public key of the staff member
 * @param decider_name legal name of the staff member
 * @param is_active true if the staff member may act from @a last_change on
 * @param read_only true if the staff member has read-only access
 * @param master_sig_valid true if the exchange's offline master key really
 *        did sign this status; a status that fails the check confers no
 *        authority but is still recorded, so that the finding is raised once
 *        rather than on every round
 * @param last_change when the status took effect, as claimed by the exchange
 * @return query result status
 */
enum GNUNET_DB_QueryStatus
TALER_AUDITORDB_insert_aml_staff (
  struct TALER_AUDITORDB_PostgresContext *pg,
  const struct TALER_AmlOfficerPublicKeyP *decider_pub,
  const char *decider_name,
  bool is_active,
  bool read_only,
  bool master_sig_valid,
  struct GNUNET_TIME_Timestamp last_change);

#endif
