Map<String, dynamic> toJson() => { 'stops': stops.map((stop) => stop.toJson()).toList(), 'direction': direction.name, };