part of 'product_loader_bloc.dart';

@freezed
class ProductLoaderState with _$ProductLoaderState {
  const factory ProductLoaderState({
    required List<Product> products,
    required Option<ProductFailure> failureOptionProduct,
    String? categoryId,
    String? search,
    @Default(false) bool isFetching,
    @Default(false) bool hasReachedMax,
    @Default(1) int page,
  }) = _ProductLoaderState;

  factory ProductLoaderState.initial() =>
      ProductLoaderState(products: [], failureOptionProduct: none());
}
