import 'dart:developer';

class GetCMCAllOrdersResponseModel {
  int? iD;
  int? patientId;
  int? patientOutSa;
  bool? isOutPatient;
  int? projectId;
  int? nearestProjectId;
  dynamic longitude;
  dynamic latitude;
  dynamic appointmentNo;
  dynamic dischargeId;
  int? statusId;
  int? serviceId;
  int? channel;
  Orderpayment? orderpayment;
  dynamic orderselectedservice;
  dynamic wforder;
  dynamic orderapprovalobj;
  String? created;
  dynamic createdBy;
  dynamic modified;
  dynamic modifiedBy;
  bool? isDeleted;
  String? statusText;
  int? paymentStatus;
  dynamic clientRequestid;
  dynamic paymentStatusText;
  String? projectName;
  String? nearestProjectName;
  dynamic paymentAmount;
  WFOrder? wFOrder;
  String? serviceText;
  bool? isSentForApproval;
  int? exaCartOrderId;
  bool? isTimer;
  int? timeSeconds;
  int? totalPendingSeconds;
  int? timeMinute;
  int? timeHour;
  int? timeTotalSeconds;
  int? timeTotalMinute;
  int? timeTotalHour;
  dynamic approvalStatus;
  bool? isActive;
  int? clickButton;
  List<dynamic>? procedures;
  dynamic pickupLocation;
  dynamic dropOffLocation;
  dynamic clinicName;
  dynamic doctorName;
  dynamic branch;
  dynamic time;
  dynamic notes;

  GetCMCAllOrdersResponseModel(
      {this.iD,
      this.patientId,
      this.patientOutSa,
      this.isOutPatient,
      this.projectId,
      this.nearestProjectId,
      this.longitude,
      this.latitude,
      this.appointmentNo,
      this.dischargeId,
      this.statusId,
      this.serviceId,
      this.channel,
      this.orderpayment,
      this.orderselectedservice,
      this.wforder,
      this.orderapprovalobj,
      this.created,
      this.createdBy,
      this.modified,
      this.modifiedBy,
      this.isDeleted,
      this.statusText,
      this.paymentStatus,
      this.clientRequestid,
      this.paymentStatusText,
      this.projectName,
      this.nearestProjectName,
      this.paymentAmount,
      this.wFOrder,
      this.serviceText,
      this.isSentForApproval,
      this.exaCartOrderId,
      this.isTimer,
      this.timeSeconds,
      this.totalPendingSeconds,
      this.timeMinute,
      this.timeHour,
      this.timeTotalSeconds,
      this.timeTotalMinute,
      this.timeTotalHour,
      this.approvalStatus,
      this.isActive,
      this.clickButton,
      this.procedures,
      this.pickupLocation,
      this.dropOffLocation,
      this.clinicName,
      this.doctorName,
      this.branch,
      this.time,
      this.notes});

  GetCMCAllOrdersResponseModel.fromJson(Map<String, dynamic> json) {
    log("responseJson: $json");
    iD = json['ID'];
    patientId = json['PatientId'];
    patientOutSa = json['PatientOutSa'];
    isOutPatient = json['IsOutPatient'];
    projectId = json['ProjectId'];
    nearestProjectId = json['NearestProjectId'];
    longitude = json['Longitude'];
    latitude = json['Latitude'];
    appointmentNo = json['AppointmentNo'];
    dischargeId = json['DischargeId'];
    statusId = json['StatusId'];
    serviceId = json['ServiceId'];
    channel = json['Channel'];
    orderpayment = json['orderpayment'] != null ? Orderpayment.fromJson(json['orderpayment']) : null;
    orderselectedservice = json['orderselectedservice'];
    wforder = json['wforder'];
    orderapprovalobj = json['orderapprovalobj'];
    created = json['Created'];
    createdBy = json['CreatedBy'];
    modified = json['Modified'];
    modifiedBy = json['ModifiedBy'];
    isDeleted = json['IsDeleted'];
    statusText = json['StatusText'];
    paymentStatus = json['PaymentStatus'];
    clientRequestid = json['ClientRequestid'];
    paymentStatusText = json['PaymentStatusText'];
    projectName = json['ProjectName'];
    nearestProjectName = json['NearestProjectName'];
    paymentAmount = json['PaymentAmount'];
    wFOrder = json['WF_order'] != null ? WFOrder.fromJson(json['WF_order']) : null;
    serviceText = json['ServiceText'];
    isSentForApproval = json['isSentForApproval'];
    exaCartOrderId = json['ExaCart_OrderId'];
    isTimer = json['isTimer'];
    timeSeconds = json['TimeSeconds'];
    totalPendingSeconds = json['TotalPendingSeconds'];
    timeMinute = json['TimeMinute'];
    timeHour = json['TimeHour'];
    timeTotalSeconds = json['TimeTotalSeconds'];
    timeTotalMinute = json['TimeTotalMinute'];
    timeTotalHour = json['TimeTotalHour'];
    approvalStatus = json['ApprovalStatus'];
    isActive = json['isActive'];
    clickButton = json['ClickButton'];
    pickupLocation = json['PickupLocation'];
    dropOffLocation = json['DropOffLocation'];
    clinicName = json['clinicName'];
    doctorName = json['DoctorName'];
    branch = json['Branch'];
    time = json['Time'];
    notes = json['Notes'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['ID'] = iD;
    data['PatientId'] = patientId;
    data['PatientOutSa'] = patientOutSa;
    data['IsOutPatient'] = isOutPatient;
    data['ProjectId'] = projectId;
    data['NearestProjectId'] = nearestProjectId;
    data['Longitude'] = longitude;
    data['Latitude'] = latitude;
    data['AppointmentNo'] = appointmentNo;
    data['DischargeId'] = dischargeId;
    data['StatusId'] = statusId;
    data['ServiceId'] = serviceId;
    data['Channel'] = channel;
    if (orderpayment != null) {
      data['orderpayment'] = orderpayment!.toJson();
    }
    data['orderselectedservice'] = orderselectedservice;

    data['wforder'] = wforder;
    data['orderapprovalobj'] = orderapprovalobj;
    data['Created'] = created;
    data['CreatedBy'] = createdBy;
    data['Modified'] = modified;
    data['ModifiedBy'] = modifiedBy;
    data['IsDeleted'] = isDeleted;
    data['StatusText'] = statusText;
    data['PaymentStatus'] = paymentStatus;
    data['ClientRequestid'] = clientRequestid;
    data['PaymentStatusText'] = paymentStatusText;
    data['ProjectName'] = projectName;
    data['NearestProjectName'] = nearestProjectName;
    data['PaymentAmount'] = paymentAmount;
    if (wFOrder != null) {
      data['WF_order'] = wFOrder!.toJson();
    }
    data['ServiceText'] = serviceText;
    data['isSentForApproval'] = isSentForApproval;
    data['ExaCart_OrderId'] = exaCartOrderId;
    data['isTimer'] = isTimer;
    data['TimeSeconds'] = timeSeconds;
    data['TotalPendingSeconds'] = totalPendingSeconds;
    data['TimeMinute'] = timeMinute;
    data['TimeHour'] = timeHour;
    data['TimeTotalSeconds'] = timeTotalSeconds;
    data['TimeTotalMinute'] = timeTotalMinute;
    data['TimeTotalHour'] = timeTotalHour;
    data['ApprovalStatus'] = approvalStatus;
    data['isActive'] = isActive;
    data['ClickButton'] = clickButton;
    data['PickupLocation'] = pickupLocation;
    data['DropOffLocation'] = dropOffLocation;
    data['clinicName'] = clinicName;
    data['DoctorName'] = doctorName;
    data['Branch'] = branch;
    data['Time'] = time;
    data['Notes'] = notes;
    return data;
  }
}

class Orderpayment {
  int? iD;
  int? orderId;
  dynamic clientRequestId;
  dynamic totalAmount;
  int? paymentStatus;
  dynamic order;
  String? created;
  dynamic createdBy;
  dynamic modified;
  dynamic modifiedBy;
  bool? isDeleted;

  Orderpayment(
      {this.iD,
      this.orderId,
      this.clientRequestId,
      this.totalAmount,
      this.paymentStatus,
      this.order,
      this.created,
      this.createdBy,
      this.modified,
      this.modifiedBy,
      this.isDeleted});

  Orderpayment.fromJson(Map<String, dynamic> json) {
    iD = json['ID'];
    orderId = json['OrderId'];
    clientRequestId = json['ClientRequestId'];
    totalAmount = json['TotalAmount'];
    paymentStatus = json['PaymentStatus'];
    order = json['Order'];
    created = json['Created'];
    createdBy = json['CreatedBy'];
    modified = json['Modified'];
    modifiedBy = json['ModifiedBy'];
    isDeleted = json['IsDeleted'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['ID'] = iD;
    data['OrderId'] = orderId;
    data['ClientRequestId'] = clientRequestId;
    data['TotalAmount'] = totalAmount;
    data['PaymentStatus'] = paymentStatus;
    data['Order'] = order;
    data['Created'] = created;
    data['CreatedBy'] = createdBy;
    data['Modified'] = modified;
    data['ModifiedBy'] = modifiedBy;
    data['IsDeleted'] = isDeleted;
    return data;
  }
}

class WFOrder {
  dynamic wfButtonsDTO;
  int? iD;
  int? orderId;
  int? previousStep;
  int? nextStep;
  int? serviceId;
  dynamic order;
  String? created;
  dynamic createdBy;
  dynamic modified;
  dynamic modifiedBy;
  bool? isDeleted;

  WFOrder(
      {this.wfButtonsDTO,
      this.iD,
      this.orderId,
      this.previousStep,
      this.nextStep,
      this.serviceId,
      this.order,
      this.created,
      this.createdBy,
      this.modified,
      this.modifiedBy,
      this.isDeleted});

  WFOrder.fromJson(Map<String, dynamic> json) {
    wfButtonsDTO = json['wf_ButtonsDTO'];
    iD = json['ID'];
    orderId = json['OrderId'];
    previousStep = json['PreviousStep'];
    nextStep = json['NextStep'];
    serviceId = json['ServiceId'];
    order = json['Order'];
    created = json['Created'];
    createdBy = json['CreatedBy'];
    modified = json['Modified'];
    modifiedBy = json['ModifiedBy'];
    isDeleted = json['IsDeleted'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['wf_ButtonsDTO'] = wfButtonsDTO;
    data['ID'] = iD;
    data['OrderId'] = orderId;
    data['PreviousStep'] = previousStep;
    data['NextStep'] = nextStep;
    data['ServiceId'] = serviceId;
    data['Order'] = order;
    data['Created'] = created;
    data['CreatedBy'] = createdBy;
    data['Modified'] = modified;
    data['ModifiedBy'] = modifiedBy;
    data['IsDeleted'] = isDeleted;
    return data;
  }
}
