toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['_id'] = this.sId;
  data['orderDate'] = this.orderDate;
  data['orderId'] = this.orderId;
  data['bookingId'] = this.bookingId;
  data['cancellationReason'] = this.cancellationReason;
  data['cancellationDate'] = this.cancellationDate;
  data['returnReason'] = this.returnReason;
  data['returnRequestedDate'] = this.returnRequestedDate;
  data['returnRejectionReason'] = this.returnRejectionReason;

  data['shippingFees'] = this.shippingFees;
  data['paymentStatus'] = this.paymentStatus;
  if (this.billingAddress != null) {
    data['billingAddress'] = this.billingAddress!.toJson();
  }
  if (this.shippingAddress != null) {
    data['shippingAddress'] = this.shippingAddress!.toJson();
  }
  if (this.user != null) {
    data['user'] = this.user!.toJson();
  }
  data['subTotal'] = this.subTotal;
  data['totalGst'] = this.totalGst;
  data['totalAmount'] = this.totalAmount;
  data['orderStatus'] = this.orderStatus;
  if (this.orderItem != null) {
    data['orderItem'] = this.orderItem!.map((v) => v.toJson()).toList();
  }
  data['__typename'] = this.sTypename;
  return data;
}