// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'maintenance_stats_dto.dart';

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

_$MaintenanceStatsDtoImpl _$$MaintenanceStatsDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$MaintenanceStatsDtoImpl(
      activeContracts: (json['active_contracts'] as num?)?.toInt() ?? 0,
      totalContracts: (json['total_contracts'] as num?)?.toInt() ?? 0,
      expiring60Days: (json['expiring_60_days'] as num?)?.toInt() ?? 0,
      expiring30Days: (json['expiring_30_days'] as num?)?.toInt() ?? 0,
      expiring7Days: (json['expiring_7_days'] as num?)?.toInt() ?? 0,
      expiredContracts: (json['expired_contracts'] as num?)?.toInt() ?? 0,
      visitContracts: (json['visit_contracts'] as num?)?.toInt() ?? 0,
      remoteContracts: (json['remote_contracts'] as num?)?.toInt() ?? 0,
      upcomingVisits: (json['upcoming_visits'] as num?)?.toInt() ?? 0,
      overdueMaintenances: (json['overdue_maintenances'] as num?)?.toInt() ?? 0,
      totalRevenueAtRisk:
          (json['total_revenue_at_risk'] as num?)?.toDouble() ?? 0.0,
      completionRate: (json['completion_rate'] as num?)?.toDouble() ?? 0.0,
      updatedAt: json['updated_at'] == null
          ? null
          : DateTime.parse(json['updated_at'] as String),
    );

Map<String, dynamic> _$$MaintenanceStatsDtoImplToJson(
        _$MaintenanceStatsDtoImpl instance) =>
    <String, dynamic>{
      'active_contracts': instance.activeContracts,
      'total_contracts': instance.totalContracts,
      'expiring_60_days': instance.expiring60Days,
      'expiring_30_days': instance.expiring30Days,
      'expiring_7_days': instance.expiring7Days,
      'expired_contracts': instance.expiredContracts,
      'visit_contracts': instance.visitContracts,
      'remote_contracts': instance.remoteContracts,
      'upcoming_visits': instance.upcomingVisits,
      'overdue_maintenances': instance.overdueMaintenances,
      'total_revenue_at_risk': instance.totalRevenueAtRisk,
      'completion_rate': instance.completionRate,
      'updated_at': instance.updatedAt?.toIso8601String(),
    };

_$MaintenanceStatusCardDataImpl _$$MaintenanceStatusCardDataImplFromJson(
        Map<String, dynamic> json) =>
    _$MaintenanceStatusCardDataImpl(
      title: json['title'] as String,
      count: (json['count'] as num).toInt(),
      subtitle: json['subtitle'] as String,
      status: $enumDecode(_$MaintenanceCardStatusEnumMap, json['status']),
      actionLabel: json['actionLabel'] as String?,
    );

Map<String, dynamic> _$$MaintenanceStatusCardDataImplToJson(
        _$MaintenanceStatusCardDataImpl instance) =>
    <String, dynamic>{
      'title': instance.title,
      'count': instance.count,
      'subtitle': instance.subtitle,
      'status': _$MaintenanceCardStatusEnumMap[instance.status]!,
      'actionLabel': instance.actionLabel,
    };

const _$MaintenanceCardStatusEnumMap = {
  MaintenanceCardStatus.active: 'active',
  MaintenanceCardStatus.warning: 'warning',
  MaintenanceCardStatus.urgent: 'urgent',
  MaintenanceCardStatus.critical: 'critical',
  MaintenanceCardStatus.expired: 'expired',
};
