import 'package:dartz/dartz.dart';
import '../../../../core/errors/failures.dart';
import '../../data/models/create_product_warehouse_request.dart';
import '../entities/product_entity.dart';
import '../entities/product_stage_entity.dart';

/// Abstract repository interface for products
/// Defines the contract for product data operations
abstract class ProductsRepository {
  /// Get products for a specific warehouse and operation type
  ///
  /// [warehouseId] - The ID of the warehouse
  /// [type] - The operation type ('import' or 'export')
  /// [forceRefresh] - If true, fetch from API even if cache exists
  ///
  /// Returns Either<Failure, List<ProductEntity>>
  Future<Either<Failure, List<ProductEntity>>> getProducts(
    int warehouseId,
    String type, {
    bool forceRefresh = false,
  });

  /// Get product stages for a product in a warehouse
  ///
  /// [warehouseId] - The ID of the warehouse
  /// [productId] - The ID of the product
  ///
  /// Returns Either<Failure, List<ProductStageEntity>>
  Future<Either<Failure, List<ProductStageEntity>>> getProductDetail(
    int warehouseId,
    int productId,
  );

  /// Create product warehouse entry (import/export operation)
  ///
  /// [request] - Request containing all product warehouse details
  ///
  /// Returns Either<Failure, void>
  Future<Either<Failure, void>> createProductWarehouse(
    CreateProductWarehouseRequest request,
  );
}
