import 'package:niogu_app/features/goods/domain/entities/stock_card.dart';
import 'package:niogu_app/features/goods/domain/entities/outlet_inventory.dart';
import 'package:niogu_app/features/goods/products/domain/entities/product.dart';

abstract class IProductRepository {
  Stream<List<Product>> watchProducts(String outletId);

  Future<ProductDetail> fetchProductById(String id, bool isEditing);

  Future<List<ProductWithVariant>> fetchNewVariants(String id);

  Future<DeleteProductSnapshot> fetchDeleteProductSnapshotById(String id);

  Future<void> saveProduct({
    required UpsertProduct product,
    required List<UpsertProductVariant> productVariants,
    List<DeleteProductVariant>? deleteVariants,
    required List<UpsertOutletInventory> outletInventories,
    required List<StockCard> stockCards,
    bool modeChange = false,
    String? modeBeforeChange,
    String? modeAfterChange,
  });

  Future<void> deleteProduct(
    String id, {
    String? outletId,
    required bool canDeleteAll,
  });

  Future<bool> checkAlreadyProductByOutlet(String id);

  Stream<List<ProductChoice>> watchProductChoices();
}
