/// Use Case: Delete Review
///
/// Deletes a product review.
library;

import 'package:worker/features/reviews/domain/repositories/reviews_repository.dart';

/// Use case for deleting a product review
class DeleteReview {
  const DeleteReview(this._repository);

  final ReviewsRepository _repository;

  /// Execute the use case
  ///
  /// [name] - Review ID to delete (format: ITEM-{item_id}-{user_email})
  Future<void> call({required String name}) async {
    if (name.trim().isEmpty) {
      throw ArgumentError('Review ID cannot be empty');
    }

    await _repository.deleteReview(name: name);
  }
}
