toJson method

Map<String, dynamic> toJson(
  1. CouponModel data
)

Implementation

Map<String, dynamic> toJson(CouponModel data) {
  return {
    'id': data.id,
    'code': data.code,
    'amount': data.amount,
    'date_created': data.dateCreated,
    'date_created_gmt': data.dateCreatedGmt,
    'date_modified': data.dateModified,
    'date_modified_gmt': data.dateModifiedGmt,
    'discount_type': data.discountType,
    'description': data.description,
    'date_expires': data.dateExpires,
    'date_expires_gmt': data.dateExpiresGmt,
    'usage_count': data.usageCount,
    'individual_use': data.individualUse,
    'product_ids': data.productIds,
    'excluded_product_ids': data.excludedProductIds,
    'usage_limit': data.usageLimit,
    'usage_limit_per_user': data.usageLimitPerUser,
    'limit_usage_to_x_items': data.limitUsageToXItems,
    'free_shipping': data.freeShipping,
    'product_categories': data.productCategories,
    'excluded_product_categories': data.excludedProductCategories,
    'exclude_sale_items': data.excludeSaleItems,
    'minimum_amount': data.minimumAmount,
    'maximum_amount': data.maximumAmount,
    'email_restrictions': data.emailRestrictions,
    'used_by': data.usedBy,
    'meta_data': data.metaData,
  };
}