package models

// DecisionBundleRequest defines the structure for a request to the /decision/bundle endpoint.
type DecisionBundleRequest struct {
	StartID         string `json:"start_id,omitempty"`
	Query           string `json:"query,omitempty"`
	Role            string `json:"role"`
	MaxHops         int    `json:"max_hops,omitempty"`
	TopK            int    `json:"top_k,omitempty"`
	IncludeFullDR   bool   `json:"include_full_dr,omitempty"`
	Redaction       bool   `json:"redaction,omitempty"`
}

// DecisionRecordSummary represents a concise summary of a Decision Record.
type DecisionRecordSummary struct {
	ID              string            `json:"id"`
	Timestamp       string            `json:"timestamp"`
	Type            string            `json:"type"`
	Statement       string            `json:"statement"`
	Rationale       string            `json:"rationale,omitempty"`
	LifecycleState  string            `json:"lifecycle_state"`
	RelationToStart string            `json:"relation_to_start,omitempty"`
	Score           float64           `json:"score,omitempty"`
	Tags            []string          `json:"tags,omitempty"`
	RoleExposure    map[string]bool   `json:"role_exposure,omitempty"`
	EvidenceRefs    []string          `json:"evidence_refs,omitempty"`
	FullPayloadRef  string            `json:"full_payload_ref,omitempty"`
}

// GoalAlignment indicates how a decision aligns with project goals.
type GoalAlignment struct {
	Score   float64  `json:"score"`
	Reasons []string `json:"reasons,omitempty"`
}

// SuggestedAction defines a recommended next step.
type SuggestedAction struct {
	Type        string  `json:"type"`
	Description string  `json:"description"`
	Assignee    string  `json:"assignee"`
	Confidence  float64 `json:"confidence"`
}

// Escalation indicates if a decision requires human attention.
type Escalation struct {
	Required bool     `json:"required"`
	Who      []string `json:"who,omitempty"`
}

// DecisionBundleResponse is the structure of the dossier returned by the /decision/bundle endpoint.
type DecisionBundleResponse struct {
	BundleID           string                   `json:"bundle_id"`
	StartID            string                   `json:"start_id"`
	GeneratedAt        string                   `json:"generated_at"`
	Summary            string                   `json:"summary"`
	Timeline           []DecisionRecordSummary  `json:"timeline"`
	ConstraintsSummary []string                 `json:"constraints_summary"`
	KeyEvidenceRefs    []string                 `json:"key_evidence_refs"`
	GoalAlignment      GoalAlignment            `json:"goal_alignment"`
	SuggestedActions   []SuggestedAction        `json:"suggested_actions"`
	Escalation         Escalation               `json:"escalation"`
	Signatures         []string                 `json:"signatures,omitempty"`
	CacheHit           bool                     `json:"cache_hit"`
}
