/**
 * Category domain model. Public storefront URLs use slug; id is internal.
 */
export interface Category {
  id: string;
  parentId: string | null;
  name: string;
  slug: string;
  seoTitle: string | null;
  seoDescription: string | null;
  description?: string | null;
  /** FIX-19: true = contenedor (puede tener hijos); false = hoja (child). */
  isParent: boolean;
  emoji?: string | null;
  color?: string | null;
  bgColor?: string | null;
  textColor?: string | null;
  createdAt: Date;
  updatedAt: Date;
}

export interface NewCategory {
  parentId?: string | null;
  name: string;
  slug: string;
  seoTitle?: string | null;
  seoDescription?: string | null;
  description?: string | null;
  isParent?: boolean;
  emoji?: string | null;
  color?: string | null;
  bgColor?: string | null;
  textColor?: string | null;
}

/** Fields a category update may set. Undefined = leave unchanged; parentId null = move to root. */
export type CategoryPatch = Partial<NewCategory>;

export interface CategoryTreeNode extends Category {
  children: CategoryTreeNode[];
}
