import type { ContentAudit } from "@/types/content-audit"

/** Shape returned by GET /api/categories and mutation responses */
export type CategoryLocale = "en" | "ar" | "tr"

export interface CategoryTranslationPayload {
  name: string
  description: string | null
}

export interface CategoryApiRecord {
  id: string
  name: string
  slug: string
  description: string | null
  color: string
  iconKey: string | null
  isVisible: boolean
  articleCount: number
  doctorCount: number
  hospitalCount: number
  procedureCount: number
  createdAt: string
  translations: Record<CategoryLocale, CategoryTranslationPayload>
  audit: ContentAudit
}

export interface CategoriesListResponse {
  categories: CategoryApiRecord[]
}

export interface CategoryMutationResponse {
  category: CategoryApiRecord
}

export interface CategoryErrorResponse {
  error: string
  fieldErrors?: Record<string, string>
}
