merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

do_update_fountain.h (2554B)


      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/merchant-database/do_update_fountain.h
     18  * @brief implementation of the do_update_fountain function for Postgres
     19  * @author Bohdan Potuzhnyi
     20  */
     21 #ifndef MERCHANT_DATABASE_DO_UPDATE_FOUNTAIN_H
     22 #define MERCHANT_DATABASE_DO_UPDATE_FOUNTAIN_H
     23 
     24 #include <taler/taler_util.h>
     25 #include "merchantdb_lib.h"
     26 #include "merchant-database/do_insert_fountain.h"
     27 
     28 
     29 struct TALER_MERCHANTDB_PostgresContext;
     30 
     31 /**
     32  * Update a fountain.  Fields that are NULL keep their previous
     33  * value.  If @a replace_grants is true, the fountain's grant set is
     34  * fully replaced by @a grants; withdrawal counters are deliberately
     35  * left untouched so consumed quota survives the replacement.
     36  *
     37  * @param pg database context
     38  * @param instance_id instance the fountain belongs to
     39  * @param fountain_id public identifier of the fountain to update
     40  * @param description new description, or NULL to keep the previous one
     41  * @param poll_freq new poll frequency, or NULL to keep the previous one
     42  * @param replace_grants true to replace the grant set with @a grants
     43  * @param grants_len length of the @a grants array
     44  * @param grants new withdrawal rights of the fountain
     45  * @param[out] not_found set to true if no fountain with
     46  *        @a fountain_id exists
     47  * @param[out] unknown_slug set to the first token family slug in
     48  *        @a grants that does not exist (caller must free); the
     49  *        fountain is unchanged in that case
     50  * @return database result code
     51  */
     52 enum GNUNET_DB_QueryStatus
     53 TALER_MERCHANTDB_do_update_fountain (
     54   struct TALER_MERCHANTDB_PostgresContext *pg,
     55   const char *instance_id,
     56   const char *fountain_id,
     57   const char *description,
     58   const struct GNUNET_TIME_Relative *poll_freq,
     59   bool replace_grants,
     60   unsigned int grants_len,
     61   const struct TALER_MERCHANTDB_FountainGrant *grants,
     62   bool *not_found,
     63   char **unknown_slug);
     64 
     65 #endif