app_event_webhook.go 872 B

12345678910111213141516171819202122232425262728293031
  1. package models
  2. import (
  3. "database/sql"
  4. "github.com/google/uuid"
  5. "github.com/jmoiron/sqlx/types"
  6. "gorm.io/gorm"
  7. )
  8. // AppEventWebhooks is a gorm model for storing webhook configuration for an app
  9. type AppEventWebhooks struct {
  10. gorm.Model
  11. // ID is a unqiue identifier of an AppEventWebhook entry
  12. ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
  13. CreatedAt sql.NullTime `db:"created_at"`
  14. UpdatedAt sql.NullTime `db:"updated_at"`
  15. DeletedAt sql.NullTime `db:"deleted_at"`
  16. // AppInstanceID uniquely identifies the application this webhook URL is configured for
  17. AppInstanceID uuid.UUID `db:"app_instance_id"`
  18. // webhooksJSON is a json text holding webhook configuration for an app
  19. WebhooksJSON types.JSONText `db:"webhooks_json"`
  20. }
  21. // TableName overrides the table name
  22. func (AppEventWebhooks) TableName() string {
  23. return "app_event_webhooks"
  24. }