import type { Category, CategoryPatch, NewCategory } from './category.js';

export interface CategoryRepository {
  list(): Promise<Category[]>;
  findById(id: string): Promise<Category | undefined>;
  findBySlug(slug: string): Promise<Category | undefined>;
  create(input: NewCategory): Promise<Category>;
  update(id: string, patch: CategoryPatch): Promise<Category | undefined>;
  delete(id: string): Promise<boolean>;
  hasChildren(id: string): Promise<boolean>;
  isDescendant(candidateAncestorId: string, candidateDescendantId: string): Promise<boolean>;
}
