package types

import (
	"time"

	"github.com/google/uuid"
)

type LearningEvidenceLevel string

const (
	LearningEvidenceHypothesis LearningEvidenceLevel = "hypothesis"
	LearningEvidenceObserved   LearningEvidenceLevel = "observed"
	LearningEvidenceVerified   LearningEvidenceLevel = "verified"
)

type LearningStatus string

const (
	LearningStatusPending    LearningStatus = "pending"
	LearningStatusInProgress LearningStatus = "in_progress"
	LearningStatusResolved   LearningStatus = "resolved"
	LearningStatusWontFix    LearningStatus = "wont_fix"
	LearningStatusPromoted   LearningStatus = "promoted"
)

type LearningPriority string

const (
	LearningPriorityLow    LearningPriority = "low"
	LearningPriorityMedium LearningPriority = "medium"
	LearningPriorityHigh   LearningPriority = "high"
)

type Learning struct {
	ID                    uuid.UUID             `json:"id"`
	Summary               string                `json:"summary"`
	Details               string                `json:"details"`
	Category              string                `json:"category"`
	Area                  string                `json:"area"`
	Status                LearningStatus        `json:"status"`
	Priority              LearningPriority      `json:"priority"`
	Confidence            LearningEvidenceLevel `json:"confidence"`
	ActionRequired        bool                  `json:"action_required"`
	SourceType            string                `json:"source_type,omitempty"`
	SourceRef             string                `json:"source_ref,omitempty"`
	ProjectID             *uuid.UUID            `json:"project_id,omitempty"`
	RelatedThoughtID      *uuid.UUID            `json:"related_thought_id,omitempty"`
	RelatedSkillID        *uuid.UUID            `json:"related_skill_id,omitempty"`
	ReviewedBy            *string               `json:"reviewed_by,omitempty"`
	ReviewedAt            *time.Time            `json:"reviewed_at,omitempty"`
	DuplicateOfLearningID *uuid.UUID            `json:"duplicate_of_learning_id,omitempty"`
	SupersedesLearningID  *uuid.UUID            `json:"supersedes_learning_id,omitempty"`
	Tags                  []string              `json:"tags"`
	CreatedAt             time.Time             `json:"created_at"`
	UpdatedAt             time.Time             `json:"updated_at"`
}

type LearningFilter struct {
	Limit     int
	ProjectID *uuid.UUID
	Category  string
	Area      string
	Status    string
	Priority  string
	Tag       string
	Query     string
}
