part of 'energy_consumption_per_device_bloc.dart';

enum EnergyConsumptionPerDeviceStatus { initial, loading, loaded, failure }

final class EnergyConsumptionPerDeviceState extends Equatable {
  const EnergyConsumptionPerDeviceState({
    this.status = EnergyConsumptionPerDeviceStatus.initial,
    this.chartData = const <DeviceEnergyDataModel>[],
    this.errorMessage,
  });

  final List<DeviceEnergyDataModel> chartData;
  final EnergyConsumptionPerDeviceStatus status;
  final String? errorMessage;

  EnergyConsumptionPerDeviceState copyWith({
    List<DeviceEnergyDataModel>? chartData,
    EnergyConsumptionPerDeviceStatus? status,
    String? errorMessage,
  }) {
    return EnergyConsumptionPerDeviceState(
      chartData: chartData ?? this.chartData,
      status: status ?? this.status,
      errorMessage: errorMessage ?? this.errorMessage,
    );
  }

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