diff --git a/server/db/models/webhook.go b/server/db/models/webhook.go new file mode 100644 index 0000000..17d01a7 --- /dev/null +++ b/server/db/models/webhook.go @@ -0,0 +1,14 @@ +package models + +// Note: any change here should be reflected in providers/casandra/provider.go as it does not have model support in collection creation + +// Webhook model for db +type Webhook struct { + Key string `json:"_key,omitempty" bson:"_key,omitempty" cql:"_key,omitempty"` // for arangodb + ID string `gorm:"primaryKey;type:char(36)" json:"_id" bson:"_id" cql:"id"` + EventName string `gorm:"unique" json:"event_name" bson:"event_name" cql:"event_name"` + EndPoint string `json:"endpoint" bson:"endpoint" cql:"endpoint"` + Enabled bool `json:"enabled" bson:"enabled" cql:"enabled"` + CreatedAt int64 `json:"created_at" bson:"created_at" cql:"created_at"` + UpdatedAt int64 `json:"updated_at" bson:"updated_at" cql:"updated_at"` +} diff --git a/server/db/models/webhook_log.go b/server/db/models/webhook_log.go new file mode 100644 index 0000000..daa6fd8 --- /dev/null +++ b/server/db/models/webhook_log.go @@ -0,0 +1,15 @@ +package models + +// Note: any change here should be reflected in providers/casandra/provider.go as it does not have model support in collection creation + +// WebhookLog model for db +type WebhookLog struct { + Key string `json:"_key,omitempty" bson:"_key,omitempty" cql:"_key,omitempty"` // for arangodb + ID string `gorm:"primaryKey;type:char(36)" json:"_id" bson:"_id" cql:"id"` + HttpStatus int32 `json:"http_status" bson:"http_status" cql:"http_status"` + Response string `json:"response" bson:"response" cql:"response"` + Request string `json:"request" bson:"request" cql:"request"` + WebhookID string `gorm:"type:char(36),index:" json:"webhook_id" bson:"webhook_id" cql:"webhook_id"` + CreatedAt int64 `json:"created_at" bson:"created_at" cql:"created_at"` + UpdatedAt int64 `json:"updated_at" bson:"updated_at" cql:"updated_at"` +}