toMap method
Implementation
Map<String, dynamic> toMap() {
final map = <String, dynamic>{
'productId': productId,
'userId': userId,
'outcome': outcome.rawValue,
'answers': answers.map((a) => a.toMap()).toList(),
'offerShown': offerShown,
'offerAccepted': offerAccepted,
'pauseShown': pauseShown,
'pauseAccepted': pauseAccepted,
};
if (pauseDurationDays != null) {
map['pauseDurationDays'] = pauseDurationDays;
}
return map;
}