package sdlc

import "time"

// HistoryEntry records a single action taken in the SDLC lifecycle.
type HistoryEntry struct {
	Timestamp time.Time `yaml:"timestamp" json:"timestamp"`
	Action    string    `yaml:"action" json:"action"`
	Feature   string    `yaml:"feature,omitempty" json:"feature,omitempty"`
	Actor     string    `yaml:"actor" json:"actor"`
	Result    string    `yaml:"result,omitempty" json:"result,omitempty"`
	Output    string    `yaml:"output,omitempty" json:"output,omitempty"`
	FromPhase string    `yaml:"from_phase,omitempty" json:"from_phase,omitempty"`
	ToPhase   string    `yaml:"to_phase,omitempty" json:"to_phase,omitempty"`
}

// BlockedItem represents something that is blocked in the SDLC.
type BlockedItem struct {
	Type   string `yaml:"type" json:"type"`
	Slug   string `yaml:"slug" json:"slug"`
	Reason string `yaml:"reason" json:"reason"`
	Since  string `yaml:"since,omitempty" json:"since,omitempty"`
	RuleID string `yaml:"rule_id,omitempty" json:"rule_id,omitempty"`
}

// ActiveFeature tracks a feature in active_work.
type ActiveFeature struct {
	Slug   string       `yaml:"slug" json:"slug"`
	Branch string       `yaml:"branch,omitempty" json:"branch,omitempty"`
	Phase  FeaturePhase `yaml:"phase" json:"phase"`
}

// ActiveWork tracks all active items.
type ActiveWork struct {
	Features []ActiveFeature `yaml:"features" json:"features"`
	Patterns []string        `yaml:"patterns,omitempty" json:"patterns,omitempty"`
	Audits   []string        `yaml:"audits,omitempty" json:"audits,omitempty"`
}

// ProjectState holds project-level metadata.
type ProjectState struct {
	Name           string `yaml:"name" json:"name"`
	CurrentRoadmap string `yaml:"current_roadmap,omitempty" json:"current_roadmap,omitempty"`
}
