class RolesUserModel {
  final String uuid;
  final DateTime createdAt;
  final String email;
  final dynamic firstName;
  final dynamic lastName;
  final dynamic roleType;
  final dynamic status;
  final bool isEnabled;
  final String invitedBy;
  final dynamic phoneNumber;
  final dynamic jobTitle;
  final dynamic createdDate;
  final dynamic createdTime;

  RolesUserModel({
    required this.uuid,
    required this.createdAt,
    required this.email,
    required this.firstName,
    required this.lastName,
    required this.roleType,
    required this.status,
    required this.isEnabled,
    required this.invitedBy,
    this.phoneNumber,
    this.jobTitle,
    required this.createdDate,
    required this.createdTime,
  });

  factory RolesUserModel.fromJson(Map<String, dynamic> json) {
    return RolesUserModel(
      uuid: json['uuid'],
      createdAt: DateTime.parse(json['createdAt']),
      email: json['email'],
      firstName: json['firstName'],
      lastName: json['lastName'],
      roleType: json['roleType'].toString().toLowerCase().replaceAll("_", " "),
      status: json['status'],
      isEnabled: json['isEnabled'],
      invitedBy:
          json['invitedBy'].toString().toLowerCase().replaceAll("_", " "),
      phoneNumber: json['phoneNumber'],
      jobTitle: json['jobTitle'] == null || json['jobTitle'] == " "
          ? "_"
          : json['jobTitle'],
      createdDate: json['createdDate'],
      createdTime: json['createdTime'],
    );
  }
}
