class EmployeeInfo {
  final String id;
  final String firstName;
  final String lastName;
  final String gender;
  final String birthDate;
  final String joiningDate; 
  final String currentAddress;
  final String phoneNumber;
  final String emergencyPhoneNumber;
  final String emergencyContactPerson;
  final String aadharNumber;
  final bool isActive;
  final String? photo; 
  final String applicationUserId;
  final String jobRoleId;

  EmployeeInfo({
    required this.id,
    required this.firstName,
    required this.lastName,
    required this.gender,
    required this.birthDate,
    required this.joiningDate,
    required this.currentAddress,
    required this.phoneNumber,
    required this.emergencyPhoneNumber,
    required this.emergencyContactPerson,
    required this.aadharNumber,
    required this.isActive,
    this.photo,
    required this.applicationUserId,
    required this.jobRoleId,
  });

  factory EmployeeInfo.fromJson(Map<String, dynamic> json) {
    return EmployeeInfo(
      id: json['id']?.toString() ?? '',
      firstName: json['firstName'] ?? '',
      lastName: json['lastName'] ?? '',
      gender: json['gender'] ?? '',
      birthDate: json['birthDate'] ?? '',
      joiningDate: json['joiningDate'] ?? '',
      currentAddress: json['currentAddress'] ?? '',
      phoneNumber: json['phoneNumber'] ?? '',
      emergencyPhoneNumber: json['emergencyPhoneNumber'] ?? '',
      emergencyContactPerson: json['emergencyContactPerson'] ?? '',
      aadharNumber: json['aadharNumber'] ?? '',
      isActive: json['isActive'] ?? false,
      photo: json['photo'],
      applicationUserId: json['applicationUserId']?.toString() ?? '',
      jobRoleId: json['jobRoleId']?.toString() ?? '',
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'firstName': firstName,
      'lastName': lastName,
      'gender': gender,
      'birthDate': birthDate,
      'joiningDate': joiningDate,
      'currentAddress': currentAddress,
      'phoneNumber': phoneNumber,
      'emergencyPhoneNumber': emergencyPhoneNumber,
      'emergencyContactPerson': emergencyContactPerson,
      'aadharNumber': aadharNumber,
      'isActive': isActive,
      'photo': photo,
      'applicationUserId': applicationUserId,
      'jobRoleId': jobRoleId,
    };
  }
}
