[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: update
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: update |
Date: |
Thu, 17 Nov 2022 11:55:43 +0100 |
This is an automated email from the git hooks/post-receive script.
priscilla-huang pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 111b2732 update
111b2732 is described below
commit 111b27321d504d83f523ecbe0880f69d96a6ea82
Author: priscilla <priscilla.huang@efrei.net>
AuthorDate: Thu Nov 17 05:55:27 2022 -0500
update
---
src/include/taler_merchantdb_plugin.h | 119 +++++++++++++++++++++++++++++++++-
1 file changed, 118 insertions(+), 1 deletion(-)
diff --git a/src/include/taler_merchantdb_plugin.h
b/src/include/taler_merchantdb_plugin.h
index 3a329096..fb0b9e53 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -216,7 +216,6 @@ typedef void
unsigned int accounts_length,
const struct TALER_MERCHANTDB_AccountDetails accounts[]);
-
/**
* Typically called by `lookup_products`.
*
@@ -302,6 +301,40 @@ struct TALER_MERCHANTDB_ProductDetails
};
+/**
+ * Typically called by `lookup_templates`.
+ *
+ * @param cls a `json_t *` JSON array to build
+ * @param template_id ID of the template
+ */
+typedef void
+(*TALER_MERCHANTDB_TemplatesCallback)(void *cls,
+ const char *template_id,
+ const char *template_description);
+
+
+/**
+ * Details about a template.
+ */
+struct TALER_MERCHANTDB_TemplateDetails
+{
+ /**
+ * Description of the template.
+ */
+ const char *template_description;
+
+ /**
+ * Base64-encoded product image, or NULL.
+ */
+ const char *image;
+
+ /**
+ * In this template contract, we can have additional information.
+ */
+ const json_t *template_contract;
+};
+
+
/**
* Filter preferences.
*/
@@ -2385,6 +2418,90 @@ struct TALER_MERCHANTDB_Plugin
uint32_t offset,
const struct TALER_BlindedDenominationSignature *blind_sig);
+
+/**
+ * Lookup all of the templates the given instance has configured.
+ *
+ * @param cls closure
+ * @param instance_id instance to lookup template for
+ * @param cb function to call on all template found
+ * @param cb_cls closure for @a cb
+ * @return database result code
+ */
+enum GNUNET_DB_QueryStatus
+(*lookup_templates) (void *cls,
+ const char *instance_id,
+ TALER_MERCHANTDB_TemplatesCallback cb,
+ void *cb_cls);
+
+
+/**
+ * Lookup details about a particular template.
+ *
+ * @param cls closure
+ * @param instance_id instance to lookup template for
+ * @param template_id template to lookup
+ * @param[out] pd set to the template details on success, can be NULL
+ * (in that case we only want to check if the template exists)
+ * @return database result code
+ */
+enum GNUNET_DB_QueryStatus
+(*lookup_template) (void *cls,
+ const char *instance_id,
+ const char *template_id,
+ struct TALER_MERCHANTDB_TemplateDetails *pd);
+
+/**
+ * Delete information about a template.
+ *
+ * @param cls closure
+ * @param instance_id instance to delete product of
+ * @param template_id template to delete
+ * @return DB status code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS
+ * if template unknow.
+ */
+enum GNUNET_DB_QueryStatus
+(*delete_template) (void *cls,
+ const char *instance_id,
+ const char *template_id);
+
+
+
+/**
+ * Insert details about a particular template.
+ *
+ * @param cls closure
+ * @param instance_id instance to insert template for
+ * @param template_id template identifier of template to insert
+ * @param pd the template details to insert
+ * @return database result code
+ */
+enum GNUNET_DB_QueryStatus
+(*insert_template) (void *cls,
+ const char *instance_id,
+ const char *template_id,
+ const struct TALER_MERCHANTDB_TemplateDetails *pd);
+
+
+
+/**
+ * Update details about a particular template.
+ *
+ * @param cls closure
+ * @param instance_id instance to update template for
+ * @param template_id template to update
+ * @param pd update to the template details on success, can be NULL
+ * (in that case we only want to check if the template exists)
+ * @return database result code, #GNUNET_DB_STATUS_SUCCESS_NO_RESULTS if the
template
+ * does not yet exist.
+ */
+
+enum GNUNET_DB_QueryStatus
+(*update_template) (void *cls,
+ const char *instance_id,
+ const char *template_id,
+ const struct TALER_MERCHANTDB_TemplateDetails *pd);
+
};
#endif
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-merchant] branch master updated: Update, gnunet, 2022/11/17
- [taler-merchant] branch master updated: update, gnunet, 2022/11/17
- [taler-merchant] branch master updated: update,
gnunet <=
- [taler-merchant] branch master updated: update, gnunet, 2022/11/17
- [taler-merchant] branch master updated: update, gnunet, 2022/11/18
- [taler-merchant] branch master updated: update, gnunet, 2022/11/21
- [taler-merchant] branch master updated: update, gnunet, 2022/11/24
- [taler-merchant] branch master updated: Update, gnunet, 2022/11/24