export interface HelpCategory {
  id: number;
  name: string;
  slug: string;
  icon: string;
  description?: string | null;
  sortOrder?: number;
  active?: boolean;
  articlesCount?: number;
}

export interface HelpArticle {
  id: number;
  categoryId?: number | null;
  category?: HelpCategory;
  title: string;
  slug: string;
  summary?: string | null;
  content?: string;
  images?: string[];
  videos?: string[];
  tags?: string[];
  relatedArticleIds?: number[];
  views?: number;
  likes?: number;
  dislikes?: number;
  featured?: boolean;
  status?: "draft" | "published";
  author?: string | null;
  seoTitle?: string | null;
  seoDescription?: string | null;
  sortOrder?: number;
  updatedAt?: string;
  createdAt?: string;
}

export interface HelpArticleDetail {
  article: HelpArticle;
  related: HelpArticle[];
}

export interface HelpTicket {
  id: number;
  user_id?: number | null;
  name?: string | null;
  email?: string | null;
  is_customer?: boolean | null;
  phone?: string | null;
  company?: string | null;
  ticket_category?: string | null;
  preferred_contact?: string | null;
  project_reference?: string | null;
  subject: string;
  message: string;
  status: string;
  priority: string;
  assigned_to?: number | null;
  source?: string;
  created_at?: string;
  user?: { id: number; name: string; email: string };
  assignee?: { id: number; name: string };
}

export interface HelpAnalytics {
  topArticles: Pick<HelpArticle, "id" | "title" | "slug" | "views" | "likes" | "dislikes">[];
  topSearches: { query: string; total: number }[];
  searchesWithoutResults: { query: string; created_at: string }[];
  ticketsOpen: number;
  ticketsTotal: number;
  resolutionRate: number;
  publishedArticles: number;
}
