// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'products_provider.dart';

// **************************************************************************
// RiverpodGenerator
// **************************************************************************

// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning
/// Products Local DataSource Provider

@ProviderFor(productsLocalDataSource)
const productsLocalDataSourceProvider = ProductsLocalDataSourceProvider._();

/// Products Local DataSource Provider

final class ProductsLocalDataSourceProvider
    extends
        $FunctionalProvider<
          ProductsLocalDataSource,
          ProductsLocalDataSource,
          ProductsLocalDataSource
        >
    with $Provider<ProductsLocalDataSource> {
  /// Products Local DataSource Provider
  const ProductsLocalDataSourceProvider._()
    : super(
        from: null,
        argument: null,
        retry: null,
        name: r'productsLocalDataSourceProvider',
        isAutoDispose: true,
        dependencies: null,
        $allTransitiveDependencies: null,
      );

  @override
  String debugGetCreateSourceHash() => _$productsLocalDataSourceHash();

  @$internal
  @override
  $ProviderElement<ProductsLocalDataSource> $createElement(
    $ProviderPointer pointer,
  ) => $ProviderElement(pointer);

  @override
  ProductsLocalDataSource create(Ref ref) {
    return productsLocalDataSource(ref);
  }

  /// {@macro riverpod.override_with_value}
  Override overrideWithValue(ProductsLocalDataSource value) {
    return $ProviderOverride(
      origin: this,
      providerOverride: $SyncValueProvider<ProductsLocalDataSource>(value),
    );
  }
}

String _$productsLocalDataSourceHash() =>
    r'c9f87b0affb7b86b890c38175b2b5ff328b7cfa4';

/// Products Remote DataSource Provider

@ProviderFor(productsRemoteDataSource)
const productsRemoteDataSourceProvider = ProductsRemoteDataSourceProvider._();

/// Products Remote DataSource Provider

final class ProductsRemoteDataSourceProvider
    extends
        $FunctionalProvider<
          AsyncValue<ProductsRemoteDataSource>,
          ProductsRemoteDataSource,
          FutureOr<ProductsRemoteDataSource>
        >
    with
        $FutureModifier<ProductsRemoteDataSource>,
        $FutureProvider<ProductsRemoteDataSource> {
  /// Products Remote DataSource Provider
  const ProductsRemoteDataSourceProvider._()
    : super(
        from: null,
        argument: null,
        retry: null,
        name: r'productsRemoteDataSourceProvider',
        isAutoDispose: true,
        dependencies: null,
        $allTransitiveDependencies: null,
      );

  @override
  String debugGetCreateSourceHash() => _$productsRemoteDataSourceHash();

  @$internal
  @override
  $FutureProviderElement<ProductsRemoteDataSource> $createElement(
    $ProviderPointer pointer,
  ) => $FutureProviderElement(pointer);

  @override
  FutureOr<ProductsRemoteDataSource> create(Ref ref) {
    return productsRemoteDataSource(ref);
  }
}

String _$productsRemoteDataSourceHash() =>
    r'4f08cec50d95b05954ca18a7b04d5f09d1ffd059';

/// Products Repository Provider

@ProviderFor(productsRepository)
const productsRepositoryProvider = ProductsRepositoryProvider._();

/// Products Repository Provider

final class ProductsRepositoryProvider
    extends
        $FunctionalProvider<
          AsyncValue<ProductsRepository>,
          ProductsRepository,
          FutureOr<ProductsRepository>
        >
    with
        $FutureModifier<ProductsRepository>,
        $FutureProvider<ProductsRepository> {
  /// Products Repository Provider
  const ProductsRepositoryProvider._()
    : super(
        from: null,
        argument: null,
        retry: null,
        name: r'productsRepositoryProvider',
        isAutoDispose: true,
        dependencies: null,
        $allTransitiveDependencies: null,
      );

  @override
  String debugGetCreateSourceHash() => _$productsRepositoryHash();

  @$internal
  @override
  $FutureProviderElement<ProductsRepository> $createElement(
    $ProviderPointer pointer,
  ) => $FutureProviderElement(pointer);

  @override
  FutureOr<ProductsRepository> create(Ref ref) {
    return productsRepository(ref);
  }
}

String _$productsRepositoryHash() =>
    r'f1ddd3ec17bbbb70e87a8d47e7c58f681c80c2ae';

/// Products Provider
///
/// Fetches and filters products based on selected category and search query.
/// Automatically updates when category or search query changes.
/// Data is fetched from Frappe ERPNext API with pagination support.
///
/// Usage:
/// ```dart
/// final productsAsync = ref.watch(productsProvider);
///
/// productsAsync.when(
///   data: (products) => ProductGrid(products: products),
///   loading: () => const CustomLoadingIndicator(),
///   error: (error, stack) => ErrorWidget(error),
/// );
/// ```

@ProviderFor(Products)
const productsProvider = ProductsProvider._();

/// Products Provider
///
/// Fetches and filters products based on selected category and search query.
/// Automatically updates when category or search query changes.
/// Data is fetched from Frappe ERPNext API with pagination support.
///
/// Usage:
/// ```dart
/// final productsAsync = ref.watch(productsProvider);
///
/// productsAsync.when(
///   data: (products) => ProductGrid(products: products),
///   loading: () => const CustomLoadingIndicator(),
///   error: (error, stack) => ErrorWidget(error),
/// );
/// ```
final class ProductsProvider
    extends $AsyncNotifierProvider<Products, List<Product>> {
  /// Products Provider
  ///
  /// Fetches and filters products based on selected category and search query.
  /// Automatically updates when category or search query changes.
  /// Data is fetched from Frappe ERPNext API with pagination support.
  ///
  /// Usage:
  /// ```dart
  /// final productsAsync = ref.watch(productsProvider);
  ///
  /// productsAsync.when(
  ///   data: (products) => ProductGrid(products: products),
  ///   loading: () => const CustomLoadingIndicator(),
  ///   error: (error, stack) => ErrorWidget(error),
  /// );
  /// ```
  const ProductsProvider._()
    : super(
        from: null,
        argument: null,
        retry: null,
        name: r'productsProvider',
        isAutoDispose: true,
        dependencies: null,
        $allTransitiveDependencies: null,
      );

  @override
  String debugGetCreateSourceHash() => _$productsHash();

  @$internal
  @override
  Products create() => Products();
}

String _$productsHash() => r'502af6c2e9012a619c15fd04bfe778045739e247';

/// Products Provider
///
/// Fetches and filters products based on selected category and search query.
/// Automatically updates when category or search query changes.
/// Data is fetched from Frappe ERPNext API with pagination support.
///
/// Usage:
/// ```dart
/// final productsAsync = ref.watch(productsProvider);
///
/// productsAsync.when(
///   data: (products) => ProductGrid(products: products),
///   loading: () => const CustomLoadingIndicator(),
///   error: (error, stack) => ErrorWidget(error),
/// );
/// ```

abstract class _$Products extends $AsyncNotifier<List<Product>> {
  FutureOr<List<Product>> build();
  @$mustCallSuper
  @override
  void runBuild() {
    final created = build();
    final ref = this.ref as $Ref<AsyncValue<List<Product>>, List<Product>>;
    final element =
        ref.element
            as $ClassProviderElement<
              AnyNotifier<AsyncValue<List<Product>>, List<Product>>,
              AsyncValue<List<Product>>,
              Object?,
              Object?
            >;
    element.handleValue(ref, created);
  }
}

/// All Products Provider (no filters)
///
/// Provides all products without any filtering.
/// Useful for product selection dialogs, etc.
/// Fetches from Frappe ERPNext API.

@ProviderFor(allProducts)
const allProductsProvider = AllProductsProvider._();

/// All Products Provider (no filters)
///
/// Provides all products without any filtering.
/// Useful for product selection dialogs, etc.
/// Fetches from Frappe ERPNext API.

final class AllProductsProvider
    extends
        $FunctionalProvider<
          AsyncValue<List<Product>>,
          List<Product>,
          FutureOr<List<Product>>
        >
    with $FutureModifier<List<Product>>, $FutureProvider<List<Product>> {
  /// All Products Provider (no filters)
  ///
  /// Provides all products without any filtering.
  /// Useful for product selection dialogs, etc.
  /// Fetches from Frappe ERPNext API.
  const AllProductsProvider._()
    : super(
        from: null,
        argument: null,
        retry: null,
        name: r'allProductsProvider',
        isAutoDispose: true,
        dependencies: null,
        $allTransitiveDependencies: null,
      );

  @override
  String debugGetCreateSourceHash() => _$allProductsHash();

  @$internal
  @override
  $FutureProviderElement<List<Product>> $createElement(
    $ProviderPointer pointer,
  ) => $FutureProviderElement(pointer);

  @override
  FutureOr<List<Product>> create(Ref ref) {
    return allProducts(ref);
  }
}

String _$allProductsHash() => r'402d7c6e8d119c7c7eab5e696fb8163831259def';

/// Product Detail Provider
///
/// Fetches a single product by ID from Frappe ERPNext API.
/// Uses getProductDetail endpoint for efficient single product fetch.
///
/// Usage:
/// ```dart
/// final productAsync = ref.watch(productDetailProvider(productId: 'GIB20 G02'));
///
/// productAsync.when(
///   data: (product) => ProductDetailView(product: product),
///   loading: () => const CustomLoadingIndicator(),
///   error: (error, stack) => ErrorWidget(error),
/// );
/// ```

@ProviderFor(productDetail)
const productDetailProvider = ProductDetailFamily._();

/// Product Detail Provider
///
/// Fetches a single product by ID from Frappe ERPNext API.
/// Uses getProductDetail endpoint for efficient single product fetch.
///
/// Usage:
/// ```dart
/// final productAsync = ref.watch(productDetailProvider(productId: 'GIB20 G02'));
///
/// productAsync.when(
///   data: (product) => ProductDetailView(product: product),
///   loading: () => const CustomLoadingIndicator(),
///   error: (error, stack) => ErrorWidget(error),
/// );
/// ```

final class ProductDetailProvider
    extends $FunctionalProvider<AsyncValue<Product>, Product, FutureOr<Product>>
    with $FutureModifier<Product>, $FutureProvider<Product> {
  /// Product Detail Provider
  ///
  /// Fetches a single product by ID from Frappe ERPNext API.
  /// Uses getProductDetail endpoint for efficient single product fetch.
  ///
  /// Usage:
  /// ```dart
  /// final productAsync = ref.watch(productDetailProvider(productId: 'GIB20 G02'));
  ///
  /// productAsync.when(
  ///   data: (product) => ProductDetailView(product: product),
  ///   loading: () => const CustomLoadingIndicator(),
  ///   error: (error, stack) => ErrorWidget(error),
  /// );
  /// ```
  const ProductDetailProvider._({
    required ProductDetailFamily super.from,
    required String super.argument,
  }) : super(
         retry: null,
         name: r'productDetailProvider',
         isAutoDispose: true,
         dependencies: null,
         $allTransitiveDependencies: null,
       );

  @override
  String debugGetCreateSourceHash() => _$productDetailHash();

  @override
  String toString() {
    return r'productDetailProvider'
        ''
        '($argument)';
  }

  @$internal
  @override
  $FutureProviderElement<Product> $createElement($ProviderPointer pointer) =>
      $FutureProviderElement(pointer);

  @override
  FutureOr<Product> create(Ref ref) {
    final argument = this.argument as String;
    return productDetail(ref, productId: argument);
  }

  @override
  bool operator ==(Object other) {
    return other is ProductDetailProvider && other.argument == argument;
  }

  @override
  int get hashCode {
    return argument.hashCode;
  }
}

String _$productDetailHash() => r'ca219f1451f518c84ca1832aacb3c83920f4bfd2';

/// Product Detail Provider
///
/// Fetches a single product by ID from Frappe ERPNext API.
/// Uses getProductDetail endpoint for efficient single product fetch.
///
/// Usage:
/// ```dart
/// final productAsync = ref.watch(productDetailProvider(productId: 'GIB20 G02'));
///
/// productAsync.when(
///   data: (product) => ProductDetailView(product: product),
///   loading: () => const CustomLoadingIndicator(),
///   error: (error, stack) => ErrorWidget(error),
/// );
/// ```

final class ProductDetailFamily extends $Family
    with $FunctionalFamilyOverride<FutureOr<Product>, String> {
  const ProductDetailFamily._()
    : super(
        retry: null,
        name: r'productDetailProvider',
        dependencies: null,
        $allTransitiveDependencies: null,
        isAutoDispose: true,
      );

  /// Product Detail Provider
  ///
  /// Fetches a single product by ID from Frappe ERPNext API.
  /// Uses getProductDetail endpoint for efficient single product fetch.
  ///
  /// Usage:
  /// ```dart
  /// final productAsync = ref.watch(productDetailProvider(productId: 'GIB20 G02'));
  ///
  /// productAsync.when(
  ///   data: (product) => ProductDetailView(product: product),
  ///   loading: () => const CustomLoadingIndicator(),
  ///   error: (error, stack) => ErrorWidget(error),
  /// );
  /// ```

  ProductDetailProvider call({required String productId}) =>
      ProductDetailProvider._(argument: productId, from: this);

  @override
  String toString() => r'productDetailProvider';
}
