toJSON method
Implementation
@override
Map<String, dynamic> toJSON() {
Map<String, dynamic> json = {};
if (unplanned != null) {
json['unplanned'] = unplanned?.toJSON();
}
if (amount != null) {
json = {
...json,
'amount': {
'currency': amount?.currency,
'value': amount?.value,
'exponent': amount?.exponent,
}
};
}
if (plans.isNotEmpty) {
json['plan'] = plans.map((plan) => plan.toJSON()).toList();
}
if (custom.isNotEmpty) {
json['custom'] = custom;
}
return json;
}