class TelemedUser {
  late String uid;
  String? email;
  String? phoneNumber;
  late String role;

  TelemedUser({
    required this.uid,
    this.email,
    this.phoneNumber,
    required this.role,
  });

  TelemedUser.fromJson(Map<String, dynamic> json, String userId) {
    uid = userId;
    email = json['email'] as String?;
    phoneNumber = json['phoneNumber'] as String?;
    role = (json['UserType'] ?? json['role']) as String;
  }

  Map<String, dynamic> toJson() {
    return {
      'uid': uid,
      'email': email,
      'phoneNumber': phoneNumber,
      'UserType': role,
    };
  }
}
