toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'code': code,
      'quantity': quantity,
      if (reasons != null) 'reasons': [for (final g in reasons!) {'code': g.code, 'quantity': g.quantity}],
    };