export interface MarketingAnalysisV3Result {
  "0_executive_summary": ExecutiveSummary;
  "1_market_landscape": MarketLandscape;
  "2_geo_structure": GeoStructure;
  "3_competitor_map": CompetitorProfile[];
  "4_content_profile": ContentProfile;
  "5_competition_intensity": CompetitionIntensity;
  "6_reputation_analysis": ReputationAnalysis;
  "7_behavioral_pattern": BehavioralPattern;
  "8_search_demand": SearchDemand;
  "9_user_positioning": UserPositioning;
  "10_structured_conclusions": string[];
  "11_smm_strategy_rationale": string;
}

export interface ExecutiveSummary {
  businessStage: string;
  geography: string;
  activeCompetitors: number;
  competitionLevel: string;
  averageNicheEr: string;
  averageRating: number;
  demandTrend: string;
  keyFigures: string[];
}

export interface TimeSeriesPoint {
  period: string;
  value: number;
}

export interface MarketLandscape {
  activePlayersByPlatform: Record<string, number>;
  cityDistribution: Record<string, number>;
  demandDynamics: TimeSeriesPoint[];
  nicheReputationLevel: number;
}

export interface CityMetrics {
  city: string;
  activePlayers: number;
  avgEr: number;
  avgRating: number;
  avgPostsPerMonth: number;
}

export interface GeoStructure {
  cityComparison: CityMetrics[];
  densityIndex: number;
}

export interface CompetitorProfile {
  name: string;
  platform: string;
  followers: number;
  postsPerMonth: number;
  er: number;
  rating: number;
  reviews: number;
  strengths: string[];
  weaknesses: string[];
}

export interface ContentProfile {
  demoContentPercent: number;
  expertContentPercent: number;
  salesContentPercent: number;
  reviewsContentPercent: number;
  engagementContentPercent: number;
  videoShare: number;
  avgTextLength: string;
  ctaFrequency: string;
}

export interface CompetitionIntensity {
  ciiIndex: number;
  intensityLabel: string;
  contributingFactors: string[];
}

export interface ReputationAnalysis {
  avgNicheRating: number;
  medianReviews: number;
  starDistribution: Record<string, number>;
  highTrustBusinessShare: number;
  avgOwnerResponseSpeed: string;
}

export interface BehavioralPattern {
  promoFrequency: string;
  bookingFrequency: string;
  dmRequestFrequency: string;
  priceVisibility: string;
  avgCycleDuration: string;
  commonCta: string[];
}

export interface SearchDemand {
  avgFrequency: string;
  seasonality: TimeSeriesPoint[];
  peakPeriods: string[];
  relatedQueries: string[];
}

export interface RadarMetrics {
  activity: number;
  engagement: number;
  video: number;
  reputation: number;
  frequency: number;
}

export interface UserPositioning {
  radarChart: RadarMetrics;
  status: string;
  gaps: string[];
}

export type MarketingAnalysisStatus =
  | "QUEUED"
  | "PROCESSING"
  | "COMPLETED"
  | "FAILED";

export interface MarketingAnalysisV3Document {
  id: string;
  userId: string;
  status: MarketingAnalysisStatus;
  requestData: unknown;
  resultData?: MarketingAnalysisV3Result;
  errorMessage?: string;
  createdAt: string;
  updatedAt: string;
}

