import 'dart:async';

import 'package:flutter/material.dart';

import '../entities/index.dart';
import 'cart_item_meta_data.dart';
import 'mixin/index.dart';

abstract class CartModel
    with
        CartMixin,
        AddressMixin,
        LocalMixin,
        CouponMixin,
        CurrencyMixin,
        MagentoMixin,
        VendorMixin,
        OrderDeliveryMixin,
        ChangeNotifier {
  @override
  double? getSubTotal();

  double getItemTotal({
    ProductVariation? productVariation,
    Product? product,
    int quantity = 1,
  });

  @override
  double? getTotal();

  String updateQuantity(Product product, String key, int quantity);

  void removeItemFromCart(String key);

  @override
  Product? getProductById(String id);

  @override
  ProductVariation? getProductVariationById(String key);

  Future<void> clearCart({isSaveRemote = true, isSaveLocal = true});

  void setOrderNotes(String note);

  void initData();

  @override
  FutureOr<(bool, String)> addProductToCart({
    required BuildContext context,
    required Product product,
    int quantity = 1,
    Function? notify,
    isSaveLocal = true,
    isSaveRemote = true,
    CartItemMetaData? cartItemMetaData,
  });

  void setRewardTotal(double total);

  @override
  void loadSavedCoupon();

  @override
  void setWalletAmount(double total);

  @override
  bool isWalletCart();

  @override
  bool isB2BKingCart();

  @override
  void setTaxInfo(List<Tax> taxes, double taxesTotal, bool isIncludingTax);

  @override
  void setFees(List<Fee> fees);
}
