class SearchUser {
  final String userId;
  final String firstName;
  final String lastName;
  final String email;
  final String mobileNo;
  final String alternateMobileNo;
  String? empCode;
  final String roleId;

  SearchUser({
    required this.userId,
    required this.firstName,
    required this.lastName,
    required this.email,
    required this.mobileNo,
    required this.alternateMobileNo,
    this.empCode,
    required this.roleId,
  });

  factory SearchUser.fromJson(Map<String, dynamic> json) {
    return SearchUser(
      userId: json['user_id'].toString(),
      firstName: json['first_name'].toString() ?? '',
      lastName: json['last_name'].toString() ?? '',
      email: json['email'].toString() ?? '',
      mobileNo: json['mobile_no'].toString() ?? '',
      alternateMobileNo: json['alternate_mobile_no'].toString() ?? '',
      empCode: json['employee_code'].toString() ?? '',
      roleId: json['role_id'].toString() ?? '',
    );
  }
}
