class Doctor {
  List<String>? achievements;
  String? uid;
  String? profileImage;
  String? profileImageUrl;
  String? speciality;
  String? yearsOfExperience;
  String? licenseNumber;
  String? profileDescription;
  String? digitalSignature;
  String? title;
  String? surName;
  String? middleName;
  String? firstName;
  List<String>? qualifications = [];
  String? floorBuilding;
  String? street;
  String? city;
  String? state;
  String? country;
  String? postalCode;
  String? addressType;

  Doctor({
    this.profileImageUrl,
    this.addressType,
    this.achievements,
    this.profileImage, // Initialize with empty list
    this.speciality,
    this.yearsOfExperience,
    this.licenseNumber,
    this.profileDescription,
    this.digitalSignature,
    this.title,
    this.surName,
    this.middleName,
    this.firstName,
    this.qualifications,
    this.floorBuilding,
    this.street,
    this.city,
    this.state,
    this.country,
    this.postalCode,
    this.uid,
  });

  Map<String, dynamic> toJson() => {
        'profileImagePath': profileImageUrl,
        'profileImage': profileImage,
        'achievements': achievements,
        'speciality': speciality,
        'yearsOfExperience': yearsOfExperience,
        'licenseNumber': licenseNumber,
        'profileDescription': profileDescription,
        'digitalSignature': digitalSignature,
        'title': title,
        'surname': surName,
        'firstName': firstName,
        'middleName': middleName,
        'qualifications': qualifications,
        'floorBuilding': floorBuilding,
        'street': street,
        'city': city,
        'state': state,
        'country': country,
        'postalCode': postalCode,
        'addressType': addressType
      };

  static Doctor fromJson(Map<String, dynamic> json) => Doctor(
      profileImageUrl: json['profileImageUrl'],
      achievements: List<String>.from(json['achievements'] ?? []),
      profileImage: json['profileImage'],
      speciality: json['speciality'],
      yearsOfExperience: json['yearsOfExperience'],
      licenseNumber: json['licenseNumber'],
      profileDescription: json['profileDescription'],
      digitalSignature: json['digitalSignature'],
      title: json['title'],
      surName: json['surname'],
      middleName: json['middleName'],
      firstName: json['firstName'],
      qualifications: List<String>.from(json['qualifications'] ?? []),
      floorBuilding: json['floorBuilding'],
      street: json['street'],
      city: json['city'],
      state: json['state'],
      country: json['country'],
      postalCode: json['postalCode'],
      addressType: json['addressType'],
      uid: json['uid']);
}
