class OrdersModel {
  List<Orders> orders;

  OrdersModel({this.orders});

  OrdersModel.fromJson(Map<String, dynamic> json) {
    if (json['orders'] != null) {
      orders = new List<Orders>();
      json['orders'].forEach((v) {
        orders.add(new Orders.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.orders != null) {
      data['orders'] = this.orders.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Orders {
  String id;
  int productCount;
  dynamic orderTotal;
  String createdOnUtc;
  int orderStatusId;
  String orderStatus;
  String orderStatusn;
  bool  canCancel;
  bool  canRefund;
  String orderGuid;
  dynamic customerId;
  dynamic orderSubtotalExclTax;
  dynamic orderShippingExclTax;
  dynamic orderTax;


  Orders(
      {this.id,
        this.productCount,
        this.orderTotal,
        this.createdOnUtc,
        this.orderStatusId,
        this.orderStatus,
        this.orderStatusn,
        this.canCancel,
        this.canRefund,
        this.orderGuid,
        this.customerId,
        this.orderShippingExclTax,
        this.orderSubtotalExclTax,
        this.orderTax,});

  Orders.fromJson(Map<String, dynamic> json) {
    try {
      id = json['id'];
      productCount = json['product_count'];
      orderTotal = json['order_total'];
      createdOnUtc = json['created_on_utc'];
      orderStatusId = json['order_status_id'];
      orderStatus = json['order_status'];
      orderStatusn = json['order_statusn'];
      canCancel = json['can_cancel'];
      canRefund = json['can_refund'];
      orderGuid = json['order_guid'];
      customerId = json['customer_id'];
      orderSubtotalExclTax= json["order_subtotal_excl_tax"];
      orderShippingExclTax= json["order_shipping_excl_tax"];
      orderTax= json["order_tax"];
    }catch(e){
      print(e);
    }

  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['product_count'] = this.productCount;
    data['order_total'] = this.orderTotal;
    data['created_on_utc'] = this.createdOnUtc;
    data['order_status_id'] = this.orderStatusId;
    data['order_status'] = this.orderStatus;
    data['order_statusn'] = this.orderStatusn;
    data ["order_subtotal_excl_tax"] = this.orderSubtotalExclTax;
    data ["order_shipping_excl_tax"]= this.orderShippingExclTax;
    data ["order_tax"]= this.orderTax;
    return data;
  }
}
