part of '../product.dart';

abstract class IProductRepository {
  Future<Either<ProductFailure, Unit>> saveProductsBatch(
    List<Product> products,
  );

  Future<Either<ProductFailure, ListProduct>> getProducts({
    int page = 1,
    int limit = 10,
    String? categoryId,
    String? search,
    bool forceRefresh = false,
  });

  Future<Either<ProductFailure, ListProduct>> getRemoteProducts({
    int page = 1,
    int limit = 10,
    String? categoryId,
    String? search,
  });

  Future<Either<ProductFailure, List<Product>>> searchProductsOptimized(
    String query,
  );

  Future<Either<ProductFailure, String>> syncAllProducts();

  Future<Either<ProductFailure, ListProduct>> refreshProducts({
    String? categoryId,
    String? search,
  });

  Future<Either<ProductFailure, Product>> getProductById(String id);

  Future<bool> hasLocalProducts();

  Future<Either<ProductFailure, Map<String, dynamic>>> getDatabaseStats();

  void clearCache();

  Future<bool> isLocalDatabaseReady();

  Future<void> clearAllProducts();
}
