part of 'sync_setting_bloc.dart';

@freezed
class SyncSettingState with _$SyncSettingState {
  factory SyncSettingState({
    required Map<String, dynamic> productStats,
    required Map<String, dynamic> categoryStats,
    required Option<CategoryFailure> failureOptionCategory,
    required Option<ProductFailure> failureOptionProduct,
    required Option<Either<ProductFailure, String>> failureOptionSyncProduct,
    required Option<Either<CategoryFailure, String>> failureOptionSyncCategory,
    @Default(false) bool isSyncing,
    @Default(false) bool isLoading,
  }) = _SyncSettingState;

  factory SyncSettingState.initial() => SyncSettingState(
    productStats: {},
    categoryStats: {},
    failureOptionCategory: none(),
    failureOptionProduct: none(),
    failureOptionSyncProduct: none(),
    failureOptionSyncCategory: none(),
  );
}
