toJson method

Map<String, dynamic> toJson()

Convertir a JSON para exportación

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'timestamp': timestamp.toIso8601String(),
    'rule_key': ruleKey,
    'rule_name': ruleName,
    'event_type': eventType,
    'status': status.name,
    'context': context,
    'start_time': startTime?.toIso8601String(),
    'end_time': endTime?.toIso8601String(),
    'duration_ms': durationMs,
    'result': result?.toJson(),
    'error': error,
  };
}