toJSON method

Map<String, dynamic> toJSON()

Implementation

Map<String, dynamic> toJSON() {
  return <String, dynamic> {
    'id': id,
    'code': code,
    'amount': amount,
    'ownerEmail': ownerEmail,
    'ownerAmount': ownerAmount,
    'description': description,
    'type': type.name,
    'usageLimit': usageLimit,
    'usedBy': usedBy,
    'productIds': productIds,
    'excludedProductIds': excludedProductIds,
    'allowedEmails': allowedEmails,
    'excludedEmails': excludedEmails
  };
}