class PendingOrdersRes {
  int rowID;
  int orderID;
  String firstName;
  String middleName;
  String lastName;
  int gender;
  String nationalityID;
  String mobileNumber;
  String preferredLanguage;
  int driverID;
  int statusID;
  bool ispaused;
  int groupID;
  String description;
  String descriptionN;
  double longitude;
  double latitude;
  dynamic amount;
  String orderCreatedOn;
  dynamic ePharmacyOrderNo;
  int projectID;
  String appointmentNo;
  String dischargeID;
  String patientID;
  bool patientOutSA;
  dynamic distanceInKilometers;
  List<ItemsQuantitiesList> itemsQuantitiesList;

  PendingOrdersRes(
      {this.rowID,
      this.orderID,
      this.firstName,
      this.middleName,
      this.lastName,
      this.gender,
      this.nationalityID,
      this.mobileNumber,
      this.preferredLanguage,
      this.driverID,
      this.statusID,
      this.ispaused,
      this.groupID,
      this.description,
      this.descriptionN,
      this.longitude,
      this.latitude,
      this.amount,
      this.orderCreatedOn,
      this.ePharmacyOrderNo,
      this.projectID,
      this.appointmentNo,
      this.dischargeID,
      this.patientID,
      this.patientOutSA,
      this.distanceInKilometers,
      this.itemsQuantitiesList});

  PendingOrdersRes.fromJson(Map<String, dynamic> json) {
    rowID = json['RowID'];
    orderID = json['OrderID'];
    firstName = json['FirstName'];
    middleName = json['MiddleName'];
    lastName = json['LastName'];
    gender = json['Gender'];
    nationalityID = json['NationalityID'];
    mobileNumber = json['MobileNumber'];
    preferredLanguage = json['PreferredLanguage'];
    driverID = json['DriverID'];
    statusID = json['StatusID'];
    ispaused = json['Ispaused'];
    groupID = json['GroupID'];
    description = json['Description'];
    descriptionN = json['DescriptionN'];
    longitude = json['Longitude'];
    latitude = json['Latitude'];
    amount = json['Amount'];
    orderCreatedOn = json['OrderCreatedOn'];
    ePharmacyOrderNo = json['ePharmacyOrderNo'];
    projectID = json['ProjectID'];
    appointmentNo = json['AppointmentNo'];
    dischargeID = json['DischargeID'];
    patientID = json['PatientID'];
    patientOutSA = json['PatientOutSA'];
    distanceInKilometers = json['DistanceInKilometers'];
    if (json['ItemsQuantitiesList'] != null) {
      itemsQuantitiesList = new List<ItemsQuantitiesList>();
      json['ItemsQuantitiesList'].forEach((v) {
        itemsQuantitiesList.add(new ItemsQuantitiesList.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['RowID'] = this.rowID;
    data['OrderID'] = this.orderID;
    data['FirstName'] = this.firstName;
    data['MiddleName'] = this.middleName;
    data['LastName'] = this.lastName;
    data['Gender'] = this.gender;
    data['NationalityID'] = this.nationalityID;
    data['MobileNumber'] = this.mobileNumber;
    data['PreferredLanguage'] = this.preferredLanguage;
    data['DriverID'] = this.driverID;
    data['StatusID'] = this.statusID;
    data['Ispaused'] = this.ispaused;
    data['GroupID'] = this.groupID;
    data['Description'] = this.description;
    data['DescriptionN'] = this.descriptionN;
    data['Longitude'] = this.longitude;
    data['Latitude'] = this.latitude;
    data['Amount'] = this.amount;
    data['OrderCreatedOn'] = this.orderCreatedOn;
    data['ePharmacyOrderNo'] = this.ePharmacyOrderNo;
    data['ProjectID'] = this.projectID;
    data['AppointmentNo'] = this.appointmentNo;
    data['DischargeID'] = this.dischargeID;
    data['PatientID'] = this.patientID;
    data['PatientOutSA'] = this.patientOutSA;
    data['DistanceInKilometers'] = this.distanceInKilometers;
    if (this.itemsQuantitiesList != null) {
      data['ItemsQuantitiesList'] =
          this.itemsQuantitiesList.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class ItemsQuantitiesList {
  String itemName;
  var productID;
  var quantity;

  ItemsQuantitiesList({this.itemName, this.productID, this.quantity});

  ItemsQuantitiesList.fromJson(Map<String, dynamic> json) {
    itemName = json['ItemName'];
    productID = json['ProductID'];
    quantity = json['Quantity'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();

    data['ItemName'] = this.itemName;
    data['ProductID'] = this.productID;

    data['Quantity'] = this.quantity;

    return data;
  }
}
