package rule import "time" // Rule is the current editable rule definition. Historical evaluations keep a // complete versioned snapshot, so editing this row never rewrites history. type Rule struct { ID string `json:"id" gorm:"type:uuid;primaryKey"` Code string `json:"code" gorm:"size:128;not null;uniqueIndex"` Name string `json:"name" gorm:"size:128;not null"` Enabled bool `json:"enabled" gorm:"not null;default:true;index"` EventType *string `json:"eventType,omitempty" gorm:"size:128"` MinimumSeverity string `json:"minimumSeverity" gorm:"size:16;not null"` LocationContains *string `json:"locationContains,omitempty" gorm:"size:128"` Version int `json:"version" gorm:"not null;default:1"` CreatedBy int `json:"createdBy" gorm:"not null"` UpdatedBy int `json:"updatedBy" gorm:"not null"` CreatedAt time.Time `json:"createdAt" gorm:"type:timestamptz;not null"` UpdatedAt time.Time `json:"updatedAt" gorm:"type:timestamptz;not null"` } func (Rule) TableName() string { return "bell_rules" }