Map<String, dynamic> toMap() { return { 'events': events?.map((x) => x.toMap()).toList(), 'prod_id': prodId, 'properties': properties, }; }