import '../domain/product_category.dart';
import '../domain/product_publishing_repository.dart';

/// Use case: create a new product category.
///
/// Delegates to [ProductPublishingRepository.createCategory] and returns the
/// created [ProductCategory].
class CreateCategory {
  final ProductPublishingRepository _repository;

  const CreateCategory(this._repository);

  Future<ProductCategory> call({required String name, int parentId = 0}) {
    return _repository.createCategory(name: name, parentId: parentId);
  }
}
