class ordersDetailsEditOrderViewResponse {
  OrderDetails? orderDetails;
  List<States>? states;
  String? error;
  String? message;

  ordersDetailsEditOrderViewResponse(
      {this.orderDetails, this.states, this.error, this.message});

  ordersDetailsEditOrderViewResponse.fromJson(Map<String, dynamic> json) {
    orderDetails = json['order_details'] != null
        ? new OrderDetails.fromJson(json['order_details'])
        : null;
    if (json['states'] != null) {
      states = <States>[];
      json['states'].forEach((v) {
        states!.add(new States.fromJson(v));
      });
    }
    error = json['error'];
    message = json['message'];
  }

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

class OrderDetails {
  String? id;
  String? orderNumber;
  String? orderNumberHash;
  String? accId;
  String? refType;
  String? refId;
  String? salesPersonEmpId;
  String? enteredEmpId;
  String? dispatchStateId;
  String? dispatchDistrictId;
  String? dispatchSubLocationId;
  String? dispatchPincode;
  String? dispatchAddress;
  String? basicAmount;
  String? cgstAmount;
  String? sgstAmount;
  String? igstAmount;
  String? paidAmount;
  String? totalAmount;
  String? status;
  String? orderReceivedDate;
  String? scheduledDispatchDate;
  String? otp;
  String? note;
  String? poViewFileName;
  String? poDirFilePath;
  String? unloadingScope;
  String? freightScope;
  String? erectionScope;
  String? saleOrderNumber;
  String? invoiceNumber;
  String? vehicleNumber;
  String? driverName;
  String? driverMobileNumber;
  String? tpcApplicable;
  String? requestedTpcAmount;
  String? level1TpcApprovedAmount;
  String? level2TpcApprovedAmount;
  String? tpcPaymentMode;
  String? tpcPaymentReferenceNo;
  String? tpcPaymentAttachmentDirFilePath;
  String? tpcPaymentAttachementViewFileName;
  String? tpcStatus;
  String? tpcAgentId;
  String? isExist;
  String? createdDatetime;
  String? updatedDatetime;
  String? accountName;
  String? gstNumber;
  String? billingAddress;
  String? district;
  String? state;
  String? subLocality;
  String? billingPincode;
  String? stateName;
  String? balanceAmount;
  String? districtName;
  String? subLocationName;
  String? adjustedAmount;
  String? enteredEmpName;
  String? salesPersonEmpName;
  Null? tpcaAgentName;

  OrderDetails(
      {this.id,
        this.orderNumber,
        this.orderNumberHash,
        this.accId,
        this.refType,
        this.refId,
        this.salesPersonEmpId,
        this.enteredEmpId,
        this.dispatchStateId,
        this.dispatchDistrictId,
        this.dispatchSubLocationId,
        this.dispatchPincode,
        this.dispatchAddress,
        this.basicAmount,
        this.cgstAmount,
        this.sgstAmount,
        this.igstAmount,
        this.paidAmount,
        this.totalAmount,
        this.status,
        this.orderReceivedDate,
        this.scheduledDispatchDate,
        this.otp,
        this.note,
        this.poViewFileName,
        this.poDirFilePath,
        this.unloadingScope,
        this.freightScope,
        this.erectionScope,
        this.saleOrderNumber,
        this.invoiceNumber,
        this.vehicleNumber,
        this.driverName,
        this.driverMobileNumber,
        this.tpcApplicable,
        this.requestedTpcAmount,
        this.level1TpcApprovedAmount,
        this.level2TpcApprovedAmount,
        this.tpcPaymentMode,
        this.tpcPaymentReferenceNo,
        this.tpcPaymentAttachmentDirFilePath,
        this.tpcPaymentAttachementViewFileName,
        this.tpcStatus,
        this.tpcAgentId,
        this.isExist,
        this.createdDatetime,
        this.updatedDatetime,
        this.accountName,
        this.gstNumber,
        this.billingAddress,
        this.district,
        this.state,
        this.subLocality,
        this.billingPincode,
        this.stateName,
        this.balanceAmount,
        this.districtName,
        this.subLocationName,
        this.adjustedAmount,
        this.enteredEmpName,
        this.salesPersonEmpName,
        this.tpcaAgentName});

  OrderDetails.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    orderNumber = json['order_number'];
    orderNumberHash = json['order_number_hash'];
    accId = json['acc_id'];
    refType = json['ref_type'];
    refId = json['ref_id'];
    salesPersonEmpId = json['sales_person_emp_id'];
    enteredEmpId = json['entered_emp_id'];
    dispatchStateId = json['dispatch_state_id'];
    dispatchDistrictId = json['dispatch_district_id'];
    dispatchSubLocationId = json['dispatch_sub_location_id'];
    dispatchPincode = json['dispatch_pincode'];
    dispatchAddress = json['dispatch_address'];
    basicAmount = json['basic_amount'];
    cgstAmount = json['cgst_amount'];
    sgstAmount = json['sgst_amount'];
    igstAmount = json['igst_amount'];
    paidAmount = json['paid_amount'];
    totalAmount = json['total_amount'];
    status = json['status'];
    orderReceivedDate = json['order_received_date'];
    scheduledDispatchDate = json['scheduled_dispatch_date'];
    otp = json['otp'];
    note = json['note'];
    poViewFileName = json['po_view_file_name'];
    poDirFilePath = json['po_dir_file_path'];
    unloadingScope = json['unloading_scope'];
    freightScope = json['freight_scope'];
    erectionScope = json['erection_scope'];
    saleOrderNumber = json['sale_order_number'];
    invoiceNumber = json['invoice_number'];
    vehicleNumber = json['vehicle_number'];
    driverName = json['driver_name'];
    driverMobileNumber = json['driver_mobile_number'];
    tpcApplicable = json['tpc_applicable'];
    requestedTpcAmount = json['requested_tpc_amount'];
    level1TpcApprovedAmount = json['level1_tpc_approved_amount'];
    level2TpcApprovedAmount = json['level2_tpc_approved_amount'];
    tpcPaymentMode = json['tpc_payment_mode'];
    tpcPaymentReferenceNo = json['tpc_payment_reference_no'];
    tpcPaymentAttachmentDirFilePath =
    json['tpc_payment_attachment_dir_file_path'];
    tpcPaymentAttachementViewFileName =
    json['tpc_payment_attachement_view_file_name'];
    tpcStatus = json['tpc_status'];
    tpcAgentId = json['tpc_agent_id'];
    isExist = json['is_exist'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
    accountName = json['account_name'];
    gstNumber = json['gst_number'];
    billingAddress = json['billing_address'];
    district = json['district'];
    state = json['state'];
    subLocality = json['sub_locality'];
    billingPincode = json['billing_pincode'];
    stateName = json['state_name'];
    balanceAmount = json['balance_amount'];
    districtName = json['district_name'];
    subLocationName = json['sub_location_name'];
    adjustedAmount = json['adjusted_amount'];
    enteredEmpName = json['entered_emp_name'];
    salesPersonEmpName = json['sales_person_emp_name'];
    tpcaAgentName = json['tpca_agent_name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['order_number'] = this.orderNumber;
    data['order_number_hash'] = this.orderNumberHash;
    data['acc_id'] = this.accId;
    data['ref_type'] = this.refType;
    data['ref_id'] = this.refId;
    data['sales_person_emp_id'] = this.salesPersonEmpId;
    data['entered_emp_id'] = this.enteredEmpId;
    data['dispatch_state_id'] = this.dispatchStateId;
    data['dispatch_district_id'] = this.dispatchDistrictId;
    data['dispatch_sub_location_id'] = this.dispatchSubLocationId;
    data['dispatch_pincode'] = this.dispatchPincode;
    data['dispatch_address'] = this.dispatchAddress;
    data['basic_amount'] = this.basicAmount;
    data['cgst_amount'] = this.cgstAmount;
    data['sgst_amount'] = this.sgstAmount;
    data['igst_amount'] = this.igstAmount;
    data['paid_amount'] = this.paidAmount;
    data['total_amount'] = this.totalAmount;
    data['status'] = this.status;
    data['order_received_date'] = this.orderReceivedDate;
    data['scheduled_dispatch_date'] = this.scheduledDispatchDate;
    data['otp'] = this.otp;
    data['note'] = this.note;
    data['po_view_file_name'] = this.poViewFileName;
    data['po_dir_file_path'] = this.poDirFilePath;
    data['unloading_scope'] = this.unloadingScope;
    data['freight_scope'] = this.freightScope;
    data['erection_scope'] = this.erectionScope;
    data['sale_order_number'] = this.saleOrderNumber;
    data['invoice_number'] = this.invoiceNumber;
    data['vehicle_number'] = this.vehicleNumber;
    data['driver_name'] = this.driverName;
    data['driver_mobile_number'] = this.driverMobileNumber;
    data['tpc_applicable'] = this.tpcApplicable;
    data['requested_tpc_amount'] = this.requestedTpcAmount;
    data['level1_tpc_approved_amount'] = this.level1TpcApprovedAmount;
    data['level2_tpc_approved_amount'] = this.level2TpcApprovedAmount;
    data['tpc_payment_mode'] = this.tpcPaymentMode;
    data['tpc_payment_reference_no'] = this.tpcPaymentReferenceNo;
    data['tpc_payment_attachment_dir_file_path'] =
        this.tpcPaymentAttachmentDirFilePath;
    data['tpc_payment_attachement_view_file_name'] =
        this.tpcPaymentAttachementViewFileName;
    data['tpc_status'] = this.tpcStatus;
    data['tpc_agent_id'] = this.tpcAgentId;
    data['is_exist'] = this.isExist;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    data['account_name'] = this.accountName;
    data['gst_number'] = this.gstNumber;
    data['billing_address'] = this.billingAddress;
    data['district'] = this.district;
    data['state'] = this.state;
    data['sub_locality'] = this.subLocality;
    data['billing_pincode'] = this.billingPincode;
    data['state_name'] = this.stateName;
    data['balance_amount'] = this.balanceAmount;
    data['district_name'] = this.districtName;
    data['sub_location_name'] = this.subLocationName;
    data['adjusted_amount'] = this.adjustedAmount;
    data['entered_emp_name'] = this.enteredEmpName;
    data['sales_person_emp_name'] = this.salesPersonEmpName;
    data['tpca_agent_name'] = this.tpcaAgentName;
    return data;
  }
}

class States {
  String? id;
  String? name;

  States({this.id, this.name});

  States.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    return data;
  }
}
