part of 'transaction_report_bloc.dart';

@freezed
class TransactionReportState with _$TransactionReportState {
  const factory TransactionReportState({
    required CategoryAnalytic categoryAnalytic,
    required ProfitLossAnalytic profitLossAnalytic,
    required PaymentMethodAnalytic paymentMethodAnalytic,
    required ProductAnalytic productAnalytic,
    required Option<AnalyticFailure> failureOptionAnalytic,
    required Outlet outlet,
    required Option<OutletFailure> failureOptionOutlet,
    @Default(false) bool isFetching,
    @Default(false) bool isFetchingOutlet,
  }) = _TransactionReportState;

  factory TransactionReportState.initial() => TransactionReportState(
    failureOptionAnalytic: none(),
    outlet: Outlet.empty(),
    failureOptionOutlet: none(),
    categoryAnalytic: CategoryAnalytic.empty(),
    profitLossAnalytic: ProfitLossAnalytic.empty(),
    paymentMethodAnalytic: PaymentMethodAnalytic.empty(),
    productAnalytic: ProductAnalytic.empty(),
  );
}
