/**
 * cli:test-report — types.ts
 * Source de vérité unique : test report execution schemas
 */
import { z } from 'zod'

export const TestReportInputSchema = z.object({
  projectPath: z.string().min(1, 'Project path is required'),
  module: z.string().min(1, 'Module name is required'),
  includeBackend: z.boolean().default(true),
  includeFrontend: z.boolean().default(true),
})

export type TestReportInput = z.infer<typeof TestReportInputSchema>

export interface LayerResult {
  total: number
  passed: number
  failed: number
  skipped: number
}

export interface TestFailure {
  test: string
  layer: string
  error: string
  file: string
}

export interface TestReportResult {
  module: string
  timestamp: string
  duration: number
  summary: {
    total: number
    passed: number
    failed: number
    skipped: number
  }
  byLayer: Record<string, LayerResult>
  failures: TestFailure[]
  coverage: {
    line: number
    branch: number
  }
}

export interface ValidationResult {
  valid: boolean
  errors: string[]
  warnings: string[]
}
