feat(integrations): align app hook payloads
This commit is contained in:
@@ -24,12 +24,15 @@ import (
|
||||
type IntegrationHook struct {
|
||||
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
AccountID uint `gorm:"not null;index" json:"account_id"`
|
||||
InboxID *uint `gorm:"index" json:"inbox_id,omitempty"` // nil = account-level hook
|
||||
HookType HookType `gorm:"size:50;not null;index" json:"hook_type"` // webhook/slack/shopify/linear/notion
|
||||
Status HookStatus `gorm:"size:20;default:'active'" json:"status"` // active/inactive
|
||||
URL string `gorm:"size:1024" json:"url"` // webhook callback URL
|
||||
AppID string `gorm:"size:100;index" json:"app_id,omitempty"`
|
||||
InboxID *uint `gorm:"index" json:"inbox_id,omitempty"` // nil = account-level hook
|
||||
Inbox *Inbox `gorm:"foreignKey:InboxID" json:"inbox,omitempty"`
|
||||
HookType HookType `gorm:"size:50;not null;index" json:"hook_type"` // webhook/slack/shopify/linear/notion
|
||||
Status HookStatus `gorm:"size:20;default:'active'" json:"status"` // active/inactive
|
||||
URL string `gorm:"size:1024" json:"url"` // webhook callback URL
|
||||
AccessToken string `gorm:"size:256;uniqueIndex" json:"access_token,omitempty"` // API token for the hook
|
||||
Settings datatypes.JSON `gorm:"type:jsonb" json:"settings"` // provider-specific config (Slack channel_id, Shopify shop_domain, etc.)
|
||||
ReferenceID string `gorm:"size:255" json:"reference_id,omitempty"`
|
||||
Settings datatypes.JSON `gorm:"type:jsonb" json:"settings"` // provider-specific config (Slack channel_id, Shopify shop_domain, etc.)
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
|
||||
@@ -38,15 +41,15 @@ type IntegrationHook struct {
|
||||
// IntegrationApp represents an available integration app definition.
|
||||
// Reference: Chatwoot Integrations::App — catalog of supported integrations
|
||||
type IntegrationApp struct {
|
||||
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
Name string `gorm:"size:255;not null" json:"name"`
|
||||
Description string `gorm:"size:512" json:"description"`
|
||||
HookType HookType `gorm:"size:50;not null;uniqueIndex" json:"hook_type"`
|
||||
Icon string `gorm:"size:512" json:"icon"` // icon URL or CSS class
|
||||
ActionURL string `gorm:"size:1024" json:"action_url"` // frontend action URL for the integration setup page
|
||||
Enabled bool `gorm:"default:true" json:"enabled"` // whether the integration is available for installation
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
Name string `gorm:"size:255;not null" json:"name"`
|
||||
Description string `gorm:"size:512" json:"description"`
|
||||
HookType HookType `gorm:"size:50;not null;uniqueIndex" json:"hook_type"`
|
||||
Icon string `gorm:"size:512" json:"icon"` // icon URL or CSS class
|
||||
ActionURL string `gorm:"size:1024" json:"action_url"` // frontend action URL for the integration setup page
|
||||
Enabled bool `gorm:"default:true" json:"enabled"` // whether the integration is available for installation
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
}
|
||||
|
||||
// SlackSettings holds Slack integration-specific configuration.
|
||||
@@ -60,7 +63,7 @@ type SlackSettings struct {
|
||||
// ShopifySettings holds Shopify integration-specific configuration.
|
||||
// Reference: Chatwoot Integrations::ShopifyController settings
|
||||
type ShopifySettings struct {
|
||||
ShopDomain string `json:"shop_domain"`
|
||||
ShopDomain string `json:"shop_domain"`
|
||||
AccessToken string `json:"access_token,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user