Convert the message to a JSON map
@override Map<String, dynamic> toJson() { return { 'type': type.value, 'documentId': documentId, 'version': version.map((e) => e.toString()).toList(), }; }