// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'dashboard_stats.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

DashboardStats _$DashboardStatsFromJson(Map<String, dynamic> json) =>
    DashboardStats(
      today: TodayStats.fromJson(json['today'] as Map<String, dynamic>),
      streaks: StreakStats.fromJson(json['streaks'] as Map<String, dynamic>),
      recentActivity: (json['recent_activity'] as List<dynamic>)
          .map((e) => RecentActivity.fromJson(e as Map<String, dynamic>))
          .toList(),
      timestamp: DashboardStats._timestampFromJson(json['timestamp']),
    );

Map<String, dynamic> _$DashboardStatsToJson(DashboardStats instance) =>
    <String, dynamic>{
      'today': instance.today,
      'streaks': instance.streaks,
      'recent_activity': instance.recentActivity,
      'timestamp': DashboardStats._timestampToJson(instance.timestamp),
    };

TodayStats _$TodayStatsFromJson(Map<String, dynamic> json) => TodayStats(
  level: (json['level'] as num).toInt(),
  xp: (json['xp'] as num).toInt(),
  focusTime: (json['focus_time'] as num).toInt(),
  meetingTime: (json['meeting_time'] as num).toInt(),
  focusSessions: (json['focus_sessions'] as num).toInt(),
);

Map<String, dynamic> _$TodayStatsToJson(TodayStats instance) =>
    <String, dynamic>{
      'level': instance.level,
      'xp': instance.xp,
      'focus_time': instance.focusTime,
      'meeting_time': instance.meetingTime,
      'focus_sessions': instance.focusSessions,
    };

StreakStats _$StreakStatsFromJson(Map<String, dynamic> json) => StreakStats(
  currentStreak: (json['current_streak'] as num).toInt(),
  longestStreak: (json['longest_streak'] as num).toInt(),
);

Map<String, dynamic> _$StreakStatsToJson(StreakStats instance) =>
    <String, dynamic>{
      'current_streak': instance.currentStreak,
      'longest_streak': instance.longestStreak,
    };

RecentActivity _$RecentActivityFromJson(Map<String, dynamic> json) =>
    RecentActivity(
      type: json['type'] as String?,
      application: json['application'] as String?,
      timestamp: RecentActivity._timestampFromJson(json['timestamp']),
      durationSeconds: (json['duration_seconds'] as num).toInt(),
    );

Map<String, dynamic> _$RecentActivityToJson(RecentActivity instance) =>
    <String, dynamic>{
      'type': instance.type,
      'application': instance.application,
      'timestamp': RecentActivity._timestampToJson(instance.timestamp),
      'duration_seconds': instance.durationSeconds,
    };

StatsHistory _$StatsHistoryFromJson(Map<String, dynamic> json) => StatsHistory(
  date: json['date'] as String,
  level: (json['level'] as num).toInt(),
  xp: (json['xp'] as num).toInt(),
  focusTime: (json['focus_time'] as num).toInt(),
  meetingTime: (json['meeting_time'] as num).toInt(),
);

Map<String, dynamic> _$StatsHistoryToJson(StatsHistory instance) =>
    <String, dynamic>{
      'date': instance.date,
      'level': instance.level,
      'xp': instance.xp,
      'focus_time': instance.focusTime,
      'meeting_time': instance.meetingTime,
    };
