class ordersDetailsDispatchOrderViewResponse {
  List<Products>? products;
  String? error;
  String? message;

  ordersDetailsDispatchOrderViewResponse(
      {this.products, this.error, this.message});

  ordersDetailsDispatchOrderViewResponse.fromJson(Map<String, dynamic> json) {
    if (json['products'] != null) {
      products = <Products>[];
      json['products'].forEach((v) {
        products!.add(new Products.fromJson(v));
      });
    }
    error = json['error'];
    message = json['message'];
  }

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

class Products {
  String? id;
  String? orderId;
  String? productId;
  String? pdiId;
  String? qty;
  String? unitPrice;
  String? cgstPercentage;
  String? sgstPercentage;
  String? igstPercentage;
  String? totalPrice;
  String? isExist;
  String? createdDatetime;
  String? updatedDatetime;
  String? productName;
  String? crmOrderPId;

  Products(
      {this.id,
        this.orderId,
        this.productId,
        this.pdiId,
        this.qty,
        this.unitPrice,
        this.cgstPercentage,
        this.sgstPercentage,
        this.igstPercentage,
        this.totalPrice,
        this.isExist,
        this.createdDatetime,
        this.updatedDatetime,
        this.productName,
        this.crmOrderPId});

  Products.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    orderId = json['order_id'];
    productId = json['product_id'];
    pdiId = json['pdi_id'];
    qty = json['qty'];
    unitPrice = json['unit_price'];
    cgstPercentage = json['cgst_percentage'];
    sgstPercentage = json['sgst_percentage'];
    igstPercentage = json['igst_percentage'];
    totalPrice = json['total_price'];
    isExist = json['is_exist'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
    productName = json['product_name'];
    crmOrderPId = json['crm_order_p_id'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['order_id'] = this.orderId;
    data['product_id'] = this.productId;
    data['pdi_id'] = this.pdiId;
    data['qty'] = this.qty;
    data['unit_price'] = this.unitPrice;
    data['cgst_percentage'] = this.cgstPercentage;
    data['sgst_percentage'] = this.sgstPercentage;
    data['igst_percentage'] = this.igstPercentage;
    data['total_price'] = this.totalPrice;
    data['is_exist'] = this.isExist;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    data['product_name'] = this.productName;
    data['crm_order_p_id'] = this.crmOrderPId;
    return data;
  }
}
