export type Category = {
  id: string
  name: string
  slug: string
  sort: number
}

export type ProductReviewsSummary = {
  approvedReviewCount: number
  avgRating: number | null
  latestApprovedText: string | null
}

export type Product = {
  id: string
  title: string
  slug: string
  shortDescription: string | null
  description: string | null
  quantity: number
  materials?: string[]
  priceCents: number
  imageUrl: string | null
  imageUrls?: string[] // legacy-friendly (used only in admin payloads)
  published: boolean
  categoryId: string
  createdAt: string
  updatedAt: string
  category?: Category
  images?: { id: string; url: string; sort: number }[]
  /** Для опубликованных товаров с публичного API. */
  reviewsSummary?: ProductReviewsSummary | null
}
