class StatsDataPoint {
  final DateTime date;
  final double trainingMax;
  final double estimated1RM;
  final double totalVolume;

  StatsDataPoint({
    required this.date,
    required this.trainingMax,
    required this.estimated1RM,
    required this.totalVolume,
  });

  factory StatsDataPoint.fromJson(Map<String, dynamic> json) {
    return StatsDataPoint(
      date: DateTime.parse(json['date']),
      trainingMax: (json['training_max'] as num).toDouble(),
      estimated1RM: (json['estimated_1rm'] as num).toDouble(),
      totalVolume: (json['total_volume'] as num).toDouble(),
    );
  }
}
