import 'product_draft.dart';
import 'publish_status.dart';

/// Contract for fetching and managing product drafts.
abstract class ProductPublishingRepository {
  /// Returns all product drafts.
  Future<List<ProductDraft>> getProductDrafts();

  /// Publishes a draft by [id]. Returns the updated draft.
  Future<ProductDraft> publishDraft(String id);

  /// Updates the publishing status of the product identified by [id].
  ///
  /// Only [PublishStatus.draft] and [PublishStatus.published] are supported
  /// in the first pass. Implementations may throw [ArgumentError] for
  /// unsupported statuses.
  ///
  /// Returns the updated [ProductDraft] reflecting the new status.
  Future<ProductDraft> updateProductStatus(String id, PublishStatus status);

  /// Updates only the price of the product identified by [id].
  ///
  /// Returns the updated [ProductDraft] reflecting the new price.
  Future<ProductDraft> updateProductPrice(String id, double price);

  /// Updates only the name of the product identified by [id].
  ///
  /// Returns the updated [ProductDraft] reflecting the new name.
  Future<ProductDraft> updateProductName(String id, String name);

  /// Updates only the description of the product identified by [id].
  ///
  /// Returns the updated [ProductDraft] reflecting the new description.
  Future<ProductDraft> updateProductDescription(String id, String description);

  /// Updates only the category of the product identified by [id].
  ///
  /// Returns the updated [ProductDraft] reflecting the new category.
  Future<ProductDraft> updateProductCategory(String id, String category);
}
