gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated: new webhook pending table


From: gnunet
Subject: [taler-merchant] branch master updated: new webhook pending table
Date: Wed, 21 Dec 2022 13:28:33 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 32db715d new webhook pending table
32db715d is described below

commit 32db715dcd16aa3ab72c61c4961351906a3a7e76
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Dec 21 13:28:30 2022 +0100

    new webhook pending table
---
 src/backenddb/merchant-0004.sql | 38 ++++++++++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)

diff --git a/src/backenddb/merchant-0004.sql b/src/backenddb/merchant-0004.sql
index 43138c22..26440816 100644
--- a/src/backenddb/merchant-0004.sql
+++ b/src/backenddb/merchant-0004.sql
@@ -47,8 +47,6 @@ COMMENT ON COLUMN merchant_template.image
 COMMENT ON COLUMN merchant_template.template_contract
   IS 'The template contract will contains some additional information.';
 
-COMMIT;
-
 
 CREATE TABLE IF NOT EXISTS merchant_webhook
   (webhook_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
@@ -67,12 +65,44 @@ COMMENT ON TABLE merchant_webhook
 COMMENT ON COLUMN merchant_webhook.event_type
   IS 'Event of the webhook';
 COMMENT ON COLUMN merchant_webhook.url
-  IS 'URL use by the customer';
+  IS 'URL to make the request to';
 COMMENT ON COLUMN merchant_webhook.http_method
   IS 'http method use by the merchant';
 COMMENT ON COLUMN merchant_webhook.header_template
-  IS 'Header of the webhook';
+  IS 'Template for the header of the webhook, to be modified based on trigger 
data';
 COMMENT ON COLUMN merchant_webhook.body_template
+  IS 'Template for the body of the webhook, to be modified based on trigger 
data';
+
+
+CREATE TABLE IF NOT EXISTS merchant_pending_webhooks
+  (webhook_pending_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
+  ,merchant_serial BIGINT NOT NULL
+    REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE
+  ,webhook_serial BIGINT NOT NULL
+    REFERENCES merchant_webhook (webhook_serial) ON DELETE CASCADE
+  ,retries INT4 NOT NULL DEFAULT(0)
+  ,next_attempt INT8 NOT NULL DEFAULT(0)
+  ,url VARCHAR NOT NULL
+  ,http_method VARCHAR NOT NULL
+  ,header VARCHAR 
+  ,body VARCHAR 
+  ,UNIQUE (merchant_serial, webhook_pending_serial)
+  );
+COMMENT ON TABLE merchant_pending_webhooks
+  IS 'webhooks that still need to be executed by the merchant';
+COMMENT ON COLUMN merchant_pending_webhooks.url
+  IS 'URL to make the request to';
+COMMENT ON COLUMN merchant_pending_webhooks.webhook_id
+  IS 'Reference to the configured webhook template';
+COMMENT ON COLUMN merchant_pending_webhooks.retries
+  IS 'How often have we tried this request so far';
+COMMENT ON COLUMN merchant_pending_webhooks.next_attempt
+  IS 'Time when we should make the next request to the webhook';
+COMMENT ON COLUMN merchant_pending_webhooks.http_method
+  IS 'http method use for the webhook';
+COMMENT ON COLUMN merchant_pending_webhooks.header_template
+  IS 'Header of the webhook';
+COMMENT ON COLUMN merchant_pending_webhooks.body_template
   IS 'Body of the webhook';
 
 COMMIT;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]