/**
 * Brand Authority Score -- Shared Types
 * ----------------------------------------
 * Types for the six-signal composite authority scoring system.
 * No third-party vendor names appear in type identifiers or JSDoc.
 */

export type AuthoritySignalStatus = "strong" | "moderate" | "weak" | "absent";
export type AuthorityTier = "Authoritative" | "Established" | "Emerging" | "Limited";

export interface AuthoritySignal {
  key:
    | "encyclopedic_presence"
    | "editorial_mentions"
    | "industry_directories"
    | "social_proof"
    | "referring_domains"
    | "branded_search_demand";
  label: string;                          // customer-facing label, no vendor names
  status: AuthoritySignalStatus;
  rawScore: number;                       // 0-100 normalized
  weight: number;                         // 0-1, vertical-aware
  weightedContribution: number;           // rawScore * weight
  evidence: string[];                     // 1-3 evidence bullets, no vendor names
  recommendation: string | null;          // actionable if not strong, no vendor names
  rawSignalData: Record<string, unknown>; // internal-only, never rendered
}

export interface BrandAuthorityScore {
  hasScore: boolean;
  overall: number;                        // 0-100 composite
  tier: AuthorityTier;
  signals: AuthoritySignal[];
  topRecommendations: string[];           // top 3 prioritized recommendations
  narrativeSummary: string;              // 2-3 sentence customer-facing, no vendor names, no em dashes
  patentRelevance: string;
  costMetrics: {
    signalsAttempted: number;
    signalsSucceeded: number;
    estimatedCostUsd: number;
    runtimeSeconds: number;
  };
  windowDate: Date;
}
