class LeadDetailsResponse {
  String? error;
  int? sessionExists;
  LeadDetails? leadDetails;
  AccountDetails? accountDetails;
  List<LeadProducts>? leadProducts;
  List<ContactDetails>? contactDetails;
  List<FollowupDetails>? followupDetails;
  List<AppointmentDetails>? appointmentDetails;
  List<QuotationsDetails>? quotationsDetails;
  String? message;
  String? showEditAccountButton;

  LeadDetailsResponse(
      {this.error,
        this.sessionExists,
        this.leadDetails,
        this.accountDetails,
        this.leadProducts,
        this.contactDetails,
        this.followupDetails,
        this.appointmentDetails,
        this.quotationsDetails,
        this.message,
        this.showEditAccountButton,
      });

  LeadDetailsResponse.fromJson(Map<String, dynamic> json) {
    error = json['error'];
    sessionExists = json['session_exists'];
    leadDetails = json['lead_details'] != null
        ? new LeadDetails.fromJson(json['lead_details'])
        : null;
    accountDetails = json['account_details'] != null
        ? new AccountDetails.fromJson(json['account_details'])
        : null;
    if (json['lead_products'] != null) {
      leadProducts = <LeadProducts>[];
      json['lead_products'].forEach((v) {
        leadProducts!.add(new LeadProducts.fromJson(v));
      });
    }
    if (json['contact_details'] != null) {
      contactDetails = <ContactDetails>[];
      json['contact_details'].forEach((v) {
        contactDetails!.add(new ContactDetails.fromJson(v));
      });
    }
    if (json['followup_details'] != null) {
      followupDetails = <FollowupDetails>[];
      json['followup_details'].forEach((v) {
        followupDetails!.add(new FollowupDetails.fromJson(v));
      });
    }
    if (json['appointment_details'] != null) {
      appointmentDetails = <AppointmentDetails>[];
      json['appointment_details'].forEach((v) {
        appointmentDetails!.add(new AppointmentDetails.fromJson(v));
      });
    }
    if (json['quotations_details'] != null) {
      quotationsDetails = <QuotationsDetails>[];
      json['quotations_details'].forEach((v) {
        quotationsDetails!.add(new QuotationsDetails.fromJson(v));
      });
    }
    message = json['message'];
    showEditAccountButton = json['show_edit_account_button'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['error'] = this.error;
    data['session_exists'] = this.sessionExists;
    if (this.leadDetails != null) {
      data['lead_details'] = this.leadDetails!.toJson();
    }
    if (this.accountDetails != null) {
      data['account_details'] = this.accountDetails!.toJson();
    }
    if (this.leadProducts != null) {
      data['lead_products'] =
          this.leadProducts!.map((v) => v.toJson()).toList();
    }
    if (this.contactDetails != null) {
      data['contact_details'] =
          this.contactDetails!.map((v) => v.toJson()).toList();
    }
    if (this.followupDetails != null) {
      data['followup_details'] =
          this.followupDetails!.map((v) => v.toJson()).toList();
    }
    if (this.appointmentDetails != null) {
      data['appointment_details'] =
          this.appointmentDetails!.map((v) => v.toJson()).toList();
    }
    if (this.quotationsDetails != null) {
      data['quotations_details'] =
          this.quotationsDetails!.map((v) => v.toJson()).toList();
    }
    data['message'] = this.message;
    data['show_edit_account_button'] = this.showEditAccountButton;
    return data;
  }
}

class LeadDetails {
  String? id;
  String? ownerId;
  String? accId;
  String? accManagerId;
  String? status;
  String? openStatus;
  String? date;
  String? closeDate;
  String? closereason;
  String? competitor;
  String? orderGainId;
  String? isExists;
  String? createdDatetime;
  String? updatedDatetime;
  String? followupFunction;
  String? name;
  String? contName;
  String? address;
  String? mob1;
  String? mob2;
  String? tel;
  String? email;
  String? prod;
  String? lage;
  String? copyMessage;

  LeadDetails(
      {this.id,
        this.ownerId,
        this.accId,
        this.accManagerId,
        this.status,
        this.openStatus,
        this.date,
        this.closeDate,
        this.closereason,
        this.competitor,
        this.orderGainId,
        this.isExists,
        this.createdDatetime,
        this.updatedDatetime,
        this.followupFunction,
        this.name,
        this.contName,
        this.address,
        this.mob1,
        this.mob2,
        this.tel,
        this.email,
        this.prod,
        this.lage,
        this.copyMessage});

  LeadDetails.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    ownerId = json['owner_id'];
    accId = json['acc_id'];
    accManagerId = json['acc_manager_id'];
    status = json['status'];
    openStatus = json['open_status'];
    date = json['date'];
    closeDate = json['close_date'];
    closereason = json['closereason'];
    competitor = json['competitor'];
    orderGainId = json['order_gain_id'];
    isExists = json['is_exists'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
    followupFunction = json['followup_function'];
    name = json['name'];
    contName = json['cont_name'];
    address = json['address'];
    mob1 = json['mob1'];
    mob2 = json['mob2'];
    tel = json['tel'];
    email = json['email'];
    prod = json['prod'];
    lage = json['lage'];
    copyMessage = json['copy_message'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['owner_id'] = this.ownerId;
    data['acc_id'] = this.accId;
    data['acc_manager_id'] = this.accManagerId;
    data['status'] = this.status;
    data['open_status'] = this.openStatus;
    data['date'] = this.date;
    data['close_date'] = this.closeDate;
    data['closereason'] = this.closereason;
    data['competitor'] = this.competitor;
    data['order_gain_id'] = this.orderGainId;
    data['is_exists'] = this.isExists;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    data['followup_function'] = this.followupFunction;
    data['name'] = this.name;
    data['cont_name'] = this.contName;
    data['address'] = this.address;
    data['mob1'] = this.mob1;
    data['mob2'] = this.mob2;
    data['tel'] = this.tel;
    data['email'] = this.email;
    data['prod'] = this.prod;
    data['lage'] = this.lage;
    data['copy_message'] = this.copyMessage;
    return data;
  }
}

class AccountDetails {
  String? id;
  String? tempId;
  String? ownerId;
  String? accManagerId;
  String? name;
  String? salutationName;
  String? subLocality;
  String? district;
  String? state;
  String? pincode;
  String? address;
  String? date;
  String? source;
  String? reference;
  String? segment;
  String? team;
  String? gstNumber;
  String? isExists;
  String? createdDatetime;
  String? updatedDatetime;
  String? email;
  String? mob1;
  String? accManager;
  String? owner;

  AccountDetails(
      {this.id,
        this.tempId,
        this.ownerId,
        this.accManagerId,
        this.name,
        this.salutationName,
        this.subLocality,
        this.district,
        this.state,
        this.pincode,
        this.address,
        this.date,
        this.source,
        this.reference,
        this.segment,
        this.team,
        this.gstNumber,
        this.isExists,
        this.createdDatetime,
        this.updatedDatetime,
        this.email,
        this.mob1,
        this.accManager,
        this.owner});

  AccountDetails.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    tempId = json['temp_id'];
    ownerId = json['owner_id'];
    accManagerId = json['acc_manager_id'];
    name = json['name'];
    salutationName = json['salutation_name'];
    subLocality = json['sub_locality'];
    district = json['district'];
    state = json['state'];
    pincode = json['pincode'];
    address = json['address'];
    date = json['date'];
    source = json['source'];
    reference = json['reference'];
    segment = json['segment'];
    team = json['team'];
    gstNumber = json['gst_number'];
    isExists = json['is_exists'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
    email = json['email'];
    mob1 = json['mob1'];
    accManager = json['acc_manager'];
    owner = json['owner'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['temp_id'] = this.tempId;
    data['owner_id'] = this.ownerId;
    data['acc_manager_id'] = this.accManagerId;
    data['name'] = this.name;
    data['salutation_name'] = this.salutationName;
    data['sub_locality'] = this.subLocality;
    data['district'] = this.district;
    data['state'] = this.state;
    data['pincode'] = this.pincode;
    data['address'] = this.address;
    data['date'] = this.date;
    data['source'] = this.source;
    data['reference'] = this.reference;
    data['segment'] = this.segment;
    data['team'] = this.team;
    data['gst_number'] = this.gstNumber;
    data['is_exists'] = this.isExists;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    data['email'] = this.email;
    data['mob1'] = this.mob1;
    data['acc_manager'] = this.accManager;
    data['owner'] = this.owner;
    return data;
  }
}

class LeadProducts {
  String? id;
  String? leadId;
  String? productId;
  String? qty;
  String? price;
  String? prodTotalPrice;
  String? date;
  String? isDel;
  String? isExists;
  String? createdDatetime;
  String? updatedDatetime;
  String? productName;

  LeadProducts(
      {this.id,
        this.leadId,
        this.productId,
        this.qty,
        this.price,
        this.prodTotalPrice,
        this.date,
        this.isDel,
        this.isExists,
        this.createdDatetime,
        this.updatedDatetime,
        this.productName});

  LeadProducts.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    leadId = json['lead_id'];
    productId = json['product_id'];
    qty = json['qty'];
    price = json['price'];
    prodTotalPrice = json['prod_total_price'];
    date = json['date'];
    isDel = json['is_del'];
    isExists = json['is_exists'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
    productName = json['product_name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['lead_id'] = this.leadId;
    data['product_id'] = this.productId;
    data['qty'] = this.qty;
    data['price'] = this.price;
    data['prod_total_price'] = this.prodTotalPrice;
    data['date'] = this.date;
    data['is_del'] = this.isDel;
    data['is_exists'] = this.isExists;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    data['product_name'] = this.productName;
    return data;
  }
}

class ContactDetails {
  String? id;
  String? accId;
  String? name;
  String? salutationName;
  String? mob1;
  String? mob2;
  String? tel;
  String? email;
  String? type;
  String? designation;
  String? date;
  String? isExists;
  String? createdDatetime;
  String? updatedDatetime;

  ContactDetails(
      {this.id,
        this.accId,
        this.name,
        this.salutationName,
        this.mob1,
        this.mob2,
        this.tel,
        this.email,
        this.type,
        this.designation,
        this.date,
        this.isExists,
        this.createdDatetime,
        this.updatedDatetime});

  ContactDetails.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    accId = json['acc_id'];
    name = json['name'];
    salutationName = json['salutation_name'];
    mob1 = json['mob1'];
    mob2 = json['mob2'];
    tel = json['tel'];
    email = json['email'];
    type = json['type'];
    designation = json['designation'];
    date = json['date'];
    isExists = json['is_exists'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['acc_id'] = this.accId;
    data['name'] = this.name;
    data['salutation_name'] = this.salutationName;
    data['mob1'] = this.mob1;
    data['mob2'] = this.mob2;
    data['tel'] = this.tel;
    data['email'] = this.email;
    data['type'] = this.type;
    data['designation'] = this.designation;
    data['date'] = this.date;
    data['is_exists'] = this.isExists;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    return data;
  }
}

class FollowupDetails {
  String? ename;
  String? ftype;
  String? fdate;
  String? finTime;
  String? foutTime;
  String? fstatus;
  String? ffeedback;

  FollowupDetails(
      {this.ename,
        this.ftype,
        this.fdate,
        this.finTime,
        this.foutTime,
        this.fstatus,
        this.ffeedback});

  FollowupDetails.fromJson(Map<String, dynamic> json) {
    ename = json['ename'];
    ftype = json['ftype'];
    fdate = json['fdate'];
    finTime = json['fin_time'];
    foutTime = json['fout_time'];
    fstatus = json['fstatus'];
    ffeedback = json['ffeedback'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['ename'] = this.ename;
    data['ftype'] = this.ftype;
    data['fdate'] = this.fdate;
    data['fin_time'] = this.finTime;
    data['fout_time'] = this.foutTime;
    data['fstatus'] = this.fstatus;
    data['ffeedback'] = this.ffeedback;
    return data;
  }
}

class AppointmentDetails {
  String? ename;
  String? aappDate;
  String? atype;
  String? anote;
  String? astatus;
  String? adate;

  AppointmentDetails(
      {this.ename,
        this.aappDate,
        this.atype,
        this.anote,
        this.astatus,
        this.adate});

  AppointmentDetails.fromJson(Map<String, dynamic> json) {
    ename = json['ename'];
    aappDate = json['aapp_date'];
    atype = json['atype'];
    anote = json['anote'];
    astatus = json['astatus'];
    adate = json['adate'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['ename'] = this.ename;
    data['aapp_date'] = this.aappDate;
    data['atype'] = this.atype;
    data['anote'] = this.anote;
    data['astatus'] = this.astatus;
    data['adate'] = this.adate;
    return data;
  }
}

class QuotationsDetails {
  String? id;
  String? empId;
  String? leadId;
  String? email;
  String? mobile;
  String? quote;
  String? info;
  String? type;
  String? quoteType;
  String? subject;
  String? taxes;
  String? spclNote;
  String? forTxt;
  String? payTerms;
  String? priceShead;
  String? extraChargeNarr;
  String? extraChargeAmount;
  String? transportCharge;
  String? loadUnloadCharge;
  String? minDuration;
  String? deliveryPeriod;
  String? minAdvance;
  String? extraHoursCharge;
  String? date;
  String? isExists;
  String? createdDatetime;
  String? updatedDatetime;
  String? employee;

  QuotationsDetails(
      {this.id,
        this.empId,
        this.leadId,
        this.email,
        this.mobile,
        this.quote,
        this.info,
        this.type,
        this.quoteType,
        this.subject,
        this.taxes,
        this.spclNote,
        this.forTxt,
        this.payTerms,
        this.priceShead,
        this.extraChargeNarr,
        this.extraChargeAmount,
        this.transportCharge,
        this.loadUnloadCharge,
        this.minDuration,
        this.deliveryPeriod,
        this.minAdvance,
        this.extraHoursCharge,
        this.date,
        this.isExists,
        this.createdDatetime,
        this.updatedDatetime,
        this.employee});

  QuotationsDetails.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    empId = json['emp_id'];
    leadId = json['lead_id'];
    email = json['email'];
    mobile = json['mobile'];
    quote = json['quote'];
    info = json['info'];
    type = json['type'];
    quoteType = json['quote_type'];
    subject = json['subject'];
    taxes = json['taxes'];
    spclNote = json['spcl_note'];
    forTxt = json['for_txt'];
    payTerms = json['pay_terms'];
    priceShead = json['price_shead'];
    extraChargeNarr = json['extra_charge_narr'];
    extraChargeAmount = json['extra_charge_amount'];
    transportCharge = json['transport_charge'];
    loadUnloadCharge = json['load_unload_charge'];
    minDuration = json['min_duration'];
    deliveryPeriod = json['delivery_period'];
    minAdvance = json['min_advance'];
    extraHoursCharge = json['extra_hours_charge'];
    date = json['date'];
    isExists = json['is_exists'];
    createdDatetime = json['created_datetime'];
    updatedDatetime = json['updated_datetime'];
    employee = json['employee'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['emp_id'] = this.empId;
    data['lead_id'] = this.leadId;
    data['email'] = this.email;
    data['mobile'] = this.mobile;
    data['quote'] = this.quote;
    data['info'] = this.info;
    data['type'] = this.type;
    data['quote_type'] = this.quoteType;
    data['subject'] = this.subject;
    data['taxes'] = this.taxes;
    data['spcl_note'] = this.spclNote;
    data['for_txt'] = this.forTxt;
    data['pay_terms'] = this.payTerms;
    data['price_shead'] = this.priceShead;
    data['extra_charge_narr'] = this.extraChargeNarr;
    data['extra_charge_amount'] = this.extraChargeAmount;
    data['transport_charge'] = this.transportCharge;
    data['load_unload_charge'] = this.loadUnloadCharge;
    data['min_duration'] = this.minDuration;
    data['delivery_period'] = this.deliveryPeriod;
    data['min_advance'] = this.minAdvance;
    data['extra_hours_charge'] = this.extraHoursCharge;
    data['date'] = this.date;
    data['is_exists'] = this.isExists;
    data['created_datetime'] = this.createdDatetime;
    data['updated_datetime'] = this.updatedDatetime;
    data['employee'] = this.employee;
    return data;
  }
}
