Serializes to a JSON map with the type discriminator (pi shape).
type
Map<String, dynamic> toJson() => { 'type': type, 'id': id, 'parentId': parentId, 'timestamp': timestamp.toIso8601String(), ...payloadJson(), };