import 'package:equatable/equatable.dart';

class EnergyDataModel extends Equatable {
  const EnergyDataModel({
    required this.date,
    required this.value,
  });

  final DateTime date;
  final double value;

  factory EnergyDataModel.fromJson(Map<String, dynamic> json) {
    return EnergyDataModel(
      date: DateTime.parse(json['date'] as String),
      value: (json['value'] as num).toDouble(),
    );
  }

  @override
  List<Object?> get props => [date, value];
}
