part of 'product_detail_bloc.dart';

class ProductDetailStateData {
  final ProductData? productData;
  final bool isFavorite;
  final bool isInCart;
  final int userId;

  ProductDetailStateData({
    this.productData,
    this.isFavorite = false,
    this.isInCart = false,
    this.userId = 0,
  });

  ProductDetailStateData copyWith({
    List<ProductData>? newInterestProducts,
    ProductData? newProductData,
    int? newUserId,
    bool? newFavorite,
    bool? newIsInCart,
  }) =>
      ProductDetailStateData(
        userId: newUserId ?? this.userId,
        productData: newProductData ?? this.productData,
        isFavorite: newFavorite ?? this.isFavorite,
        isInCart: newIsInCart ?? this.isInCart,
      );
}

abstract class ProductDetailState {
  final ProductDetailStateData data;

  ProductDetailState(this.data);
}

class InitialState extends ProductDetailState {
  InitialState(super.data);
}

class GetProductDetailSuccessState extends ProductDetailState {
  GetProductDetailSuccessState(super.data);
}

class GetProductDetailFailState extends ProductDetailState {
  GetProductDetailFailState(super.data);
}

class GetInterestProductsSuccessState extends ProductDetailState {
  GetInterestProductsSuccessState(super.data);
}

class GetInterestProductsFailState extends ProductDetailState {
  GetInterestProductsFailState(super.data);
}

class SetFavoriteSuccessState extends ProductDetailState {
  SetFavoriteSuccessState(super.data);
}

class SetFavoriteFailState extends ProductDetailState {
  SetFavoriteFailState(super.data);
}

class SetProductCartSuccessState extends ProductDetailState {
  SetProductCartSuccessState(super.data);
}

class SetProductCartFailState extends ProductDetailState {
  SetProductCartFailState(super.data);
}
