package domain

import "time"

// Diagnostic severity values.
const (
	DiagnosticSeverityInfo    = "info"
	DiagnosticSeverityWarning = "warning"
	DiagnosticSeverityError   = "error"
)

// IndexingDiagnostic records a durable indexing pipeline diagnostic.
type IndexingDiagnostic struct {
	DiagnosticID string    `bson:"diagnostic_id" json:"diagnostic_id"`
	RepoID       string    `bson:"repo_id" json:"repo_id"`
	SnapshotID   string    `bson:"snapshot_id" json:"snapshot_id"`
	Stage        string    `bson:"stage" json:"stage"`
	SourceType   string    `bson:"source_type" json:"source_type"`
	SourceID     string    `bson:"source_id" json:"source_id"`
	JobID        string    `bson:"job_id,omitempty" json:"job_id,omitempty"`
	EventID      string    `bson:"event_id,omitempty" json:"event_id,omitempty"`
	Code         string    `bson:"code" json:"code"`
	Severity     string    `bson:"severity" json:"severity"`
	Message      string    `bson:"message" json:"message"`
	CreatedAt    time.Time `bson:"created_at" json:"created_at"`
}
