Files
yovision/Bell/server/app/bell/evaluation/model.go
T

21 lines
769 B
Go

package evaluation
import (
"encoding/json"
"time"
)
// Evaluation is an immutable explanation of one rule version evaluated
// against one Event.
type Evaluation struct {
EventID string `json:"eventId" gorm:"type:uuid;primaryKey"`
RuleID string `json:"ruleId" gorm:"type:uuid;primaryKey"`
RuleVersion int `json:"ruleVersion" gorm:"not null"`
RuleSnapshot json.RawMessage `json:"ruleSnapshot" gorm:"type:jsonb;not null"`
Matched bool `json:"matched" gorm:"not null"`
Explanation string `json:"explanation" gorm:"size:512;not null"`
EvaluatedAt time.Time `json:"evaluatedAt" gorm:"type:timestamptz;not null"`
}
func (Evaluation) TableName() string { return "bell_rule_evaluations" }