class CouponModel {
  int id;
  int createTime;
  String createBy;
  int updateTime;
  String updateBy;
  String userId;
  int orderId;
  int couponId;
  int usedFlag;
  String orderNo;
  Coupon coupon;

  CouponModel(
      {this.id,
      this.createTime,
      this.createBy,
      this.updateTime,
      this.updateBy,
      this.userId,
      this.orderId,
      this.couponId,
      this.usedFlag,
      this.orderNo,
      this.coupon});

  CouponModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    createTime = json['createTime'];
    createBy = json['createBy'];
    updateTime = json['updateTime'];
    updateBy = json['updateBy'];
    userId = json['userId'];
    orderId = json['orderId'];
    couponId = json['couponId'];
    usedFlag = json['usedFlag'];
    orderNo = json['orderNo'];
    coupon =
        json['coupon'] != null ? new Coupon.fromJson(json['coupon']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['createTime'] = this.createTime;
    data['createBy'] = this.createBy;
    data['updateTime'] = this.updateTime;
    data['updateBy'] = this.updateBy;
    data['userId'] = this.userId;
    data['orderId'] = this.orderId;
    data['couponId'] = this.couponId;
    data['usedFlag'] = this.usedFlag;
    data['orderNo'] = this.orderNo;
    if (this.coupon != null) {
      data['coupon'] = this.coupon.toJson();
    }
    return data;
  }
}

class Coupon {
  int id;
  int createTime;
  String createBy;
  int updateTime;
  String updateBy;
  String name;
  int type;
  double discount;
  double price;
  double fullReduction;
  int scenario;
  int validity;
  int statuz;
  int checkFalg;
  String reason;
  String remark;

  Coupon(
      {this.id,
      this.createTime,
      this.createBy,
      this.updateTime,
      this.updateBy,
      this.name,
      this.type,
      this.discount,
      this.price,
      this.fullReduction,
      this.scenario,
      this.validity,
      this.statuz,
      this.checkFalg,
      this.reason,
      this.remark});

  Coupon.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    createTime = json['createTime'];
    createBy = json['createBy'];
    updateTime = json['updateTime'];
    updateBy = json['updateBy'];
    name = json['name'];
    type = json['type'];
    discount = json['discount'];
    price = json['price'];
    fullReduction = json['fullReduction'];
    scenario = json['scenario'];
    validity = json['validity'];
    statuz = json['statuz'];
    checkFalg = json['checkFalg'];
    reason = json['reason'];
    remark = json['remark'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['createTime'] = this.createTime;
    data['createBy'] = this.createBy;
    data['updateTime'] = this.updateTime;
    data['updateBy'] = this.updateBy;
    data['name'] = this.name;
    data['type'] = this.type;
    data['discount'] = this.discount;
    data['price'] = this.price;
    data['fullReduction'] = this.fullReduction;
    data['scenario'] = this.scenario;
    data['validity'] = this.validity;
    data['statuz'] = this.statuz;
    data['checkFalg'] = this.checkFalg;
    data['reason'] = this.reason;
    data['remark'] = this.remark;
    return data;
  }
}