/**
 * Support FAQ Types
 * Type definitions for FAQ management
 */

/** SupportFAQCategory — mirrors the Prisma enum removed during Convex migration */
export type SupportFAQCategory = 'GETTING_STARTED' | 'BILLING' | 'TECHNICAL' | 'WHATSAPP' | 'APPOINTMENTS';

/** Input for creating a new FAQ */
export interface CreateFAQInput {
  category: SupportFAQCategory;
  question: string;
  questionAr: string;
  answer: string;
  answerAr: string;
  order?: number;
  isPublished?: boolean;
}

/** Input for updating an existing FAQ */
export interface UpdateFAQInput {
  category?: SupportFAQCategory;
  question?: string;
  questionAr?: string;
  answer?: string;
  answerAr?: string;
  order?: number;
  isPublished?: boolean;
}

/** Filters for listing FAQs */
export interface FAQListFilters {
  category?: SupportFAQCategory;
  isPublished?: boolean;
  search?: string;
}

/** FAQ statistics returned with list */
export interface FAQStats {
  total: number;
  published: number;
  draft: number;
  byCategory: Record<string, number>;
}

/** Public FAQ with category slug */
export interface PublicFAQ {
  id: string;
  category: SupportFAQCategory;
  categorySlug: string;
  question: string;
  questionAr: string;
  answer: string;
  answerAr: string;
  order: number;
}

/** Staff session with role */
export interface StaffSession {
  id: string;
  email: string;
  role: string;
  name?: string;
}

/** Result of validation */
export interface ValidationResult {
  valid: boolean;
  error?: string;
}

/** Search condition for Prisma */
export interface SearchCondition {
  contains: string;
  mode: 'insensitive';
}

/** Where clause for FAQ queries */
export interface FAQWhereClause {
  isPublished?: boolean;
  category?: SupportFAQCategory;
  OR?: Array<{
    question?: SearchCondition;
    questionAr?: SearchCondition;
    answer?: SearchCondition;
    answerAr?: SearchCondition;
  }>;
}
