class tourExpensesDetailsResponse {
  RequestDetails? requestDetails;
  TourExpenses? tourExpenses;
  List<TravelExpenses>? travelExpenses;
  List<HotelExpenses>? hotelExpenses;
  List<OtherExpenses>? otherExpenses;
  String? error;
  String? message;
  int? sessionExists;

  tourExpensesDetailsResponse(
      {this.requestDetails,
        this.tourExpenses,
        this.travelExpenses,
        this.hotelExpenses,
        this.otherExpenses,
        this.error,
        this.message,
        this.sessionExists});

  tourExpensesDetailsResponse.fromJson(Map<String, dynamic> json) {
    requestDetails = json['request_details'] != null
        ? new RequestDetails.fromJson(json['request_details'])
        : null;
    tourExpenses = json['tour_expenses'] != null
        ? new TourExpenses.fromJson(json['tour_expenses'])
        : null;
    if (json['travel_expenses'] != null) {
      travelExpenses = <TravelExpenses>[];
      json['travel_expenses'].forEach((v) {
        travelExpenses!.add(new TravelExpenses.fromJson(v));
      });
    }
    if (json['hotel_expenses'] != null) {
      hotelExpenses = <HotelExpenses>[];
      json['hotel_expenses'].forEach((v) {
        hotelExpenses!.add(new HotelExpenses.fromJson(v));
      });
    }
    if (json['other_expenses'] != null) {
      otherExpenses = <OtherExpenses>[];
      json['other_expenses'].forEach((v) {
        otherExpenses!.add(new OtherExpenses.fromJson(v));
      });
    }
    error = json['error'];
    message = json['message'];
    sessionExists = json['session_exists'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.requestDetails != null) {
      data['request_details'] = this.requestDetails!.toJson();
    }
    if (this.tourExpenses != null) {
      data['tour_expenses'] = this.tourExpenses!.toJson();
    }
    if (this.travelExpenses != null) {
      data['travel_expenses'] =
          this.travelExpenses!.map((v) => v.toJson()).toList();
    }
    if (this.hotelExpenses != null) {
      data['hotel_expenses'] =
          this.hotelExpenses!.map((v) => v.toJson()).toList();
    }
    if (this.otherExpenses != null) {
      data['other_expenses'] =
          this.otherExpenses!.map((v) => v.toJson()).toList();
    }
    data['error'] = this.error;
    data['message'] = this.message;
    data['session_exists'] = this.sessionExists;
    return data;
  }
}

class RequestDetails {
  String? id;
  String? employeeName;
  String? placeOfVisit;
  String? appliedDate;
  String? fromDate;
  String? toDate;
  String? type;
  String? appliedAmount;
  String? approvedAmount;
  String? approvalStatus;
  String? tlApprovedBy;
  String? tlApprovedAmount;
  String? tlRemarks;
  String? tlApprovedDate;
  String? hrApprovedBy;
  String? hrApprovedAmount;
  String? hrRemarks;
  Null? hrApprovedDate;

  RequestDetails(
      {this.id,
        this.employeeName,
        this.placeOfVisit,
        this.appliedDate,
        this.fromDate,
        this.toDate,
        this.type,
        this.appliedAmount,
        this.approvedAmount,
        this.approvalStatus,
        this.tlApprovedBy,
        this.tlApprovedAmount,
        this.tlRemarks,
        this.tlApprovedDate,
        this.hrApprovedBy,
        this.hrApprovedAmount,
        this.hrRemarks,
        this.hrApprovedDate});

  RequestDetails.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    employeeName = json['employee_name'];
    placeOfVisit = json['place_of_visit'];
    appliedDate = json['applied_date'];
    fromDate = json['from_date'];
    toDate = json['to_date'];
    type = json['type'];
    appliedAmount = json['applied_amount'];
    approvedAmount = json['approved_amount'];
    approvalStatus = json['approval_status'];
    tlApprovedBy = json['tl_approved_by'];
    tlApprovedAmount = json['tl_approved_amount'];
    tlRemarks = json['tl_remarks'];
    tlApprovedDate = json['tl_approved_date'];
    hrApprovedBy = json['hr_approved_by'];
    hrApprovedAmount = json['hr_approved_amount'];
    hrRemarks = json['hr_remarks'];
    hrApprovedDate = json['hr_approved_date'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['employee_name'] = this.employeeName;
    data['place_of_visit'] = this.placeOfVisit;
    data['applied_date'] = this.appliedDate;
    data['from_date'] = this.fromDate;
    data['to_date'] = this.toDate;
    data['type'] = this.type;
    data['applied_amount'] = this.appliedAmount;
    data['approved_amount'] = this.approvedAmount;
    data['approval_status'] = this.approvalStatus;
    data['tl_approved_by'] = this.tlApprovedBy;
    data['tl_approved_amount'] = this.tlApprovedAmount;
    data['tl_remarks'] = this.tlRemarks;
    data['tl_approved_date'] = this.tlApprovedDate;
    data['hr_approved_by'] = this.hrApprovedBy;
    data['hr_approved_amount'] = this.hrApprovedAmount;
    data['hr_remarks'] = this.hrRemarks;
    data['hr_approved_date'] = this.hrApprovedDate;
    return data;
  }
}

class TourExpenses {
  String? placeOfVisit;
  String? da;
  String? type;
  String? appliedAmount;
  String? fromDate;
  String? toDate;
  String? extraNote;

  TourExpenses(
      {this.placeOfVisit,
        this.da,
        this.type,
        this.appliedAmount,
        this.fromDate,
        this.toDate,
        this.extraNote});

  TourExpenses.fromJson(Map<String, dynamic> json) {
    placeOfVisit = json['place_of_visit'];
    da = json['da'];
    type = json['type'];
    appliedAmount = json['applied_amount'];
    fromDate = json['from_date'];
    toDate = json['to_date'];
    extraNote = json['extra_note'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['place_of_visit'] = this.placeOfVisit;
    data['da'] = this.da;
    data['type'] = this.type;
    data['applied_amount'] = this.appliedAmount;
    data['from_date'] = this.fromDate;
    data['to_date'] = this.toDate;
    data['extra_note'] = this.extraNote;
    return data;
  }
}

class TravelExpenses {
  String? froma;
  String? toa;
  String? travelType;
  String? fare;
  String? travelBill;
  String? imageDirFilePath;

  TravelExpenses(
      {this.froma,
        this.toa,
        this.travelType,
        this.fare,
        this.travelBill,
        this.imageDirFilePath});

  TravelExpenses.fromJson(Map<String, dynamic> json) {
    froma = json['froma'];
    toa = json['toa'];
    travelType = json['travel_type'];
    fare = json['fare'];
    travelBill = json['travel_bill'];
    imageDirFilePath = json['image_dir_file_path'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['froma'] = this.froma;
    data['toa'] = this.toa;
    data['travel_type'] = this.travelType;
    data['fare'] = this.fare;
    data['travel_bill'] = this.travelBill;
    data['image_dir_file_path'] = this.imageDirFilePath;
    return data;
  }
}

class HotelExpenses {
  String? hotelName;
  String? fromDate;
  String? toDate;
  String? amount;
  String? imageDirFilePath;

  HotelExpenses(
      {this.hotelName,
        this.fromDate,
        this.toDate,
        this.amount,
        this.imageDirFilePath});

  HotelExpenses.fromJson(Map<String, dynamic> json) {
    hotelName = json['hotel_name'];
    fromDate = json['from_date'];
    toDate = json['to_date'];
    amount = json['amount'];
    imageDirFilePath = json['image_dir_file_path'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['hotel_name'] = this.hotelName;
    data['from_date'] = this.fromDate;
    data['to_date'] = this.toDate;
    data['amount'] = this.amount;
    data['image_dir_file_path'] = this.imageDirFilePath;
    return data;
  }
}

class OtherExpenses {
  String? otherAmount;
  String? otherDate;
  String? otherDesc;
  String? imageDirFilePath;

  OtherExpenses(
      {this.otherAmount,
        this.otherDate,
        this.otherDesc,
        this.imageDirFilePath});

  OtherExpenses.fromJson(Map<String, dynamic> json) {
    otherAmount = json['other_amount'];
    otherDate = json['other_date'];
    otherDesc = json['other_desc'];
    imageDirFilePath = json['image_dir_file_path'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['other_amount'] = this.otherAmount;
    data['other_date'] = this.otherDate;
    data['other_desc'] = this.otherDesc;
    data['image_dir_file_path'] = this.imageDirFilePath;
    return data;
  }
}
