| 123456789101112131415161718192021 |
- package model
- import (
- "time"
- "gorm.io/datatypes"
- )
- // NotificationConfig stores notification channel configurations.
- type NotificationConfig struct {
- ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
- Name string `gorm:"size:100;not null" json:"name"`
- EventType string `gorm:"size:50;not null;index" json:"event_type"` // task_completed/task_failed/new_hot_merchant/schedule_run
- Channel string `gorm:"size:20;not null" json:"channel"` // webhook/tg_bot
- Config datatypes.JSON `gorm:"type:json" json:"config"` // {url: "..."} or {bot_token: "...", chat_id: "..."}
- Enabled bool `gorm:"default:true" json:"enabled"`
- CreatedAt time.Time `json:"created_at"`
- UpdatedAt time.Time `json:"updated_at"`
- }
- func (NotificationConfig) TableName() string { return "notification_configs" }
|