Add failed status to webhook data
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -21,7 +21,8 @@ CREATE TABLE webhook_configurations (
|
||||
CREATE TYPE webhook_data_status AS ENUM (
|
||||
'PENDING',
|
||||
'PROCESSING',
|
||||
'DELIVERED'
|
||||
'PROCESSED',
|
||||
'FAILED'
|
||||
);
|
||||
|
||||
CREATE TABLE webhook_data (
|
||||
|
||||
@@ -24,7 +24,8 @@ type WebhookDataStatus string
|
||||
const (
|
||||
WebhookDataStatusPending WebhookDataStatus = "PENDING"
|
||||
WebhookDataStatusProcessing WebhookDataStatus = "PROCESSING"
|
||||
WebhookDataStatusDelivered WebhookDataStatus = "DELIVERED"
|
||||
WebhookDataStatusProcessed WebhookDataStatus = "PROCESSED"
|
||||
WebhookDataStatusFailed WebhookDataStatus = "FAILED"
|
||||
)
|
||||
|
||||
func (s WebhookDataStatus) String() string {
|
||||
@@ -33,7 +34,7 @@ func (s WebhookDataStatus) String() string {
|
||||
|
||||
func (s WebhookDataStatus) IsValid() bool {
|
||||
switch s {
|
||||
case WebhookDataStatusPending, WebhookDataStatusProcessing, WebhookDataStatusDelivered:
|
||||
case WebhookDataStatusPending, WebhookDataStatusProcessing, WebhookDataStatusProcessed, WebhookDataStatusFailed:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user