// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'dashboard_stats_model.dart';

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

DashboardStatsModel _$DashboardStatsModelFromJson(Map<String, dynamic> json) =>
    DashboardStatsModel(
      totalMembers: (json['totalMembers'] as num).toInt(),
      activeMembers: (json['activeMembers'] as num).toInt(),
      totalEvents: (json['totalEvents'] as num).toInt(),
      upcomingEvents: (json['upcomingEvents'] as num).toInt(),
      totalContributions: (json['totalContributions'] as num).toInt(),
      totalContributionAmount:
          (json['totalContributionAmount'] as num).toDouble(),
      pendingRequests: (json['pendingRequests'] as num).toInt(),
      completedProjects: (json['completedProjects'] as num).toInt(),
      monthlyGrowth: (json['monthlyGrowth'] as num).toDouble(),
      engagementRate: (json['engagementRate'] as num).toDouble(),
      lastUpdated: DateTime.parse(json['lastUpdated'] as String),
      totalOrganizations: (json['totalOrganizations'] as num?)?.toInt(),
      organizationTypeDistribution:
          (json['organizationTypeDistribution'] as Map<String, dynamic>?)?.map(
        (k, e) => MapEntry(k, (e as num).toInt()),
      ),
    );

Map<String, dynamic> _$DashboardStatsModelToJson(
        DashboardStatsModel instance) =>
    <String, dynamic>{
      'totalMembers': instance.totalMembers,
      'activeMembers': instance.activeMembers,
      'totalEvents': instance.totalEvents,
      'upcomingEvents': instance.upcomingEvents,
      'totalContributions': instance.totalContributions,
      'totalContributionAmount': instance.totalContributionAmount,
      'pendingRequests': instance.pendingRequests,
      'completedProjects': instance.completedProjects,
      'monthlyGrowth': instance.monthlyGrowth,
      'engagementRate': instance.engagementRate,
      'lastUpdated': instance.lastUpdated.toIso8601String(),
      'totalOrganizations': instance.totalOrganizations,
      'organizationTypeDistribution': instance.organizationTypeDistribution,
    };

RecentActivityModel _$RecentActivityModelFromJson(Map<String, dynamic> json) =>
    RecentActivityModel(
      id: json['id'] as String,
      type: json['type'] as String,
      title: json['title'] as String,
      description: json['description'] as String,
      userAvatar: json['userAvatar'] as String?,
      userName: json['userName'] as String,
      timestamp: DateTime.parse(json['timestamp'] as String),
      actionUrl: json['actionUrl'] as String?,
      metadata: json['metadata'] as Map<String, dynamic>?,
    );

Map<String, dynamic> _$RecentActivityModelToJson(
        RecentActivityModel instance) =>
    <String, dynamic>{
      'id': instance.id,
      'type': instance.type,
      'title': instance.title,
      'description': instance.description,
      'userAvatar': instance.userAvatar,
      'userName': instance.userName,
      'timestamp': instance.timestamp.toIso8601String(),
      'actionUrl': instance.actionUrl,
      'metadata': instance.metadata,
    };

UpcomingEventModel _$UpcomingEventModelFromJson(Map<String, dynamic> json) =>
    UpcomingEventModel(
      id: json['id'] as String,
      title: json['title'] as String,
      description: json['description'] as String,
      startDate: DateTime.parse(json['startDate'] as String),
      endDate: json['endDate'] == null
          ? null
          : DateTime.parse(json['endDate'] as String),
      location: json['location'] as String,
      maxParticipants: (json['maxParticipants'] as num).toInt(),
      currentParticipants: (json['currentParticipants'] as num).toInt(),
      status: json['status'] as String,
      imageUrl: json['imageUrl'] as String?,
      tags: (json['tags'] as List<dynamic>).map((e) => e as String).toList(),
    );

Map<String, dynamic> _$UpcomingEventModelToJson(UpcomingEventModel instance) =>
    <String, dynamic>{
      'id': instance.id,
      'title': instance.title,
      'description': instance.description,
      'startDate': instance.startDate.toIso8601String(),
      'endDate': instance.endDate?.toIso8601String(),
      'location': instance.location,
      'maxParticipants': instance.maxParticipants,
      'currentParticipants': instance.currentParticipants,
      'status': instance.status,
      'imageUrl': instance.imageUrl,
      'tags': instance.tags,
    };

DashboardDataModel _$DashboardDataModelFromJson(Map<String, dynamic> json) =>
    DashboardDataModel(
      stats:
          DashboardStatsModel.fromJson(json['stats'] as Map<String, dynamic>),
      recentActivities: (json['recentActivities'] as List<dynamic>)
          .map((e) => RecentActivityModel.fromJson(e as Map<String, dynamic>))
          .toList(),
      upcomingEvents: (json['upcomingEvents'] as List<dynamic>)
          .map((e) => UpcomingEventModel.fromJson(e as Map<String, dynamic>))
          .toList(),
      userPreferences: json['userPreferences'] as Map<String, dynamic>,
      organizationId: json['organizationId'] as String,
      userId: json['userId'] as String,
    );

Map<String, dynamic> _$DashboardDataModelToJson(DashboardDataModel instance) =>
    <String, dynamic>{
      'stats': instance.stats,
      'recentActivities': instance.recentActivities,
      'upcomingEvents': instance.upcomingEvents,
      'userPreferences': instance.userPreferences,
      'organizationId': instance.organizationId,
      'userId': instance.userId,
    };
