part of 'inventory_analytic_loader_bloc.dart';

@freezed
class InventoryAnalyticLoaderState with _$InventoryAnalyticLoaderState {
  const factory InventoryAnalyticLoaderState({
    required InventoryAnalytic inventoryAnalytic,
    required Option<AnalyticFailure> failureOptionInventoryAnalytic,
    @Default(false) bool isFetching,
    required DateTime dateFrom,
    required DateTime dateTo,
  }) = _InventoryAnalyticLoaderState;

  factory InventoryAnalyticLoaderState.initial() =>
      InventoryAnalyticLoaderState(
        inventoryAnalytic: InventoryAnalytic.empty(),
        failureOptionInventoryAnalytic: none(),
        dateFrom: DateTime.now().subtract(const Duration(days: 30)),
        dateTo: DateTime.now(),
      );
}
