Files
gochat/internal/model/automation_action.go
T
2026-06-04 15:44:48 +08:00

23 lines
1014 B
Go

package model
import (
"encoding/json"
"time"
)
// AutomationAction represents a single action in an automation rule.
// Reference: Chatwoot AutomationAction model + P2B M6 spec
type AutomationAction struct {
ID uint `gorm:"primaryKey" json:"id"`
AutomationRuleID uint `gorm:"not null;index" json:"automation_rule_id"`
ActionType string `gorm:"size:100;not null" json:"action_type"` // send_message/update_status/assign_agent/assign_team/add_label/webhook
ActionParams json.RawMessage `gorm:"type:jsonb;not null" json:"action_params"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
// AutomationRule is referenced via AutomationRuleID;
// the actual AutomationRule type lives in the automation sub-package
// to avoid an import cycle between model ↔ automation.
}
func (AutomationAction) TableName() string { return "automation_actions" }