import 'package:niogu_app/features/goods/domain/entities/stock_card.dart';
import 'package:niogu_app/features/goods/raw_materials/domain/entities/raw_material.dart';
import 'package:niogu_app/features/goods/domain/entities/outlet_inventory.dart';

abstract class IRawMaterialRepository {
  Stream<List<RawMaterial>> watchMaterials(String currentOutlet);

  Future<RawMaterialDetail> fetchRawMaterialById(String id, bool isEditing);

  Stream<List<ProductUsageMaterial>> watchProductUsageMaterials(String currentOutlet, bool isEditing);
  
  Future<DeleteRawMaterialSnapshot> fetchDeleteRawMaterialSnapshotById(
    String id,
  );

  Future<bool> checkAlreadyRawMaterialByOutlet(String id);

  Stream<List<RawMaterialChoice>> watchRawMaterialChoices();

  Future<void> saveRawMaterial({
    required UpsertRawMaterial rawMaterial,
    required List<UpsertReceiptItem> receiptItems,
    List<DeleteProductUsageMaterial>? deleteItems,
    required List<UpsertOutletInventory> outletInventories,
    required List<StockCard> stockCards,
  });

  Future<void> deleteRawMaterial(
    String id, {
    String? outletId,
    bool canDeleteAll = false,
  });
}
