part of 'energy_consumption_by_phases_bloc.dart';

enum EnergyConsumptionByPhasesStatus {
  initial,
  loading,
  loaded,
  failure,
}

final class EnergyConsumptionByPhasesState extends Equatable {
  const EnergyConsumptionByPhasesState({
    this.status = EnergyConsumptionByPhasesStatus.initial,
    this.chartData = const <PhasesEnergyConsumption>[],
    this.errorMessage,
  });

  final List<PhasesEnergyConsumption> chartData;
  final EnergyConsumptionByPhasesStatus status;
  final String? errorMessage;

  EnergyConsumptionByPhasesState copyWith({
    List<PhasesEnergyConsumption>? chartData,
    EnergyConsumptionByPhasesStatus? status,
    String? errorMessage,
  }) {
    return EnergyConsumptionByPhasesState(
      chartData: chartData ?? this.chartData,
      status: status ?? this.status,
      errorMessage: errorMessage ?? this.errorMessage,
    );
  }

  @override
  List<Object?> get props => [chartData, status, errorMessage];
}
