// ==============================================
// Wizard Framework Types
// ==============================================

export type StepStatus = 'pending' | 'active' | 'completed' | 'failed'

export interface WizardStep {
  id: string
  name: string
  icon: string
  status: StepStatus
  category?: string
}

export interface TestResult {
  name: string
  description: string
  expected: string
  actual: string
  status: 'passed' | 'failed' | 'pending' | 'skipped'
  duration_ms: number
  error_message?: string
}

export interface ArchitectureContext {
  layer: 'frontend' | 'api' | 'service' | 'database'
  services: string[]
  dependencies: string[]
  dataFlow: string[]
}

export interface TestCategoryResult {
  category: string
  display_name: string
  description: string
  why_important: string
  architecture_context?: ArchitectureContext
  tests: TestResult[]
  passed: number
  failed: number
  total: number
  duration_ms: number
}

export interface FullTestResults {
  timestamp: string
  categories: TestCategoryResult[]
  total_passed: number
  total_failed: number
  total_tests: number
  duration_ms: number
}

export interface EducationContent {
  title: string
  content: string[]
}

export interface StepEducation {
  stepId: string
  title: string
  whyImportant: string
  whatIsTested: string[]
  architectureHighlight?: {
    layer: string
    components: string[]
    dataFlow: string
  }
  learnMoreLinks?: {
    label: string
    url: string
  }[]
  commonMistakes?: string[]
  bestPractices?: string[]
}

export interface ModuleEducation {
  module: string
  overview: {
    title: string
    description: string
    businessValue: string
    complianceContext: string
  }
  steps: StepEducation[]
}

export interface WizardContextValue {
  currentStep: number
  steps: WizardStep[]
  setCurrentStep: (step: number) => void
  setSteps: React.Dispatch<React.SetStateAction<WizardStep[]>>
  goToNext: () => void
  goToPrev: () => void
  module: string
  categoryResults: Record<string, TestCategoryResult>
  setCategoryResults: React.Dispatch<React.SetStateAction<Record<string, TestCategoryResult>>>
  fullResults: FullTestResults | null
  setFullResults: React.Dispatch<React.SetStateAction<FullTestResults | null>>
  isLoading: boolean
  setIsLoading: React.Dispatch<React.SetStateAction<boolean>>
  error: string | null
  setError: React.Dispatch<React.SetStateAction<string | null>>
}
