Map<String, dynamic> toJson() { return { 'status': status.name, if (steps != null) 'steps': steps!.map((step) => step.toJson()).toList(), }; }