class Engineer{
  String id;
  String name;

  Engineer({
    this.id,
    this.name,
  });



  factory Engineer.fromJson(Map<String,dynamic> parsedJson){
    return Engineer(
      id: parsedJson["userId"] ?? parsedJson["id"],
      name: parsedJson["userName"] ?? parsedJson["name"],
    );
  }
  factory Engineer.fromEngineer(Engineer department){
    return Engineer(
      id: department?.id,
      name: department?.name,
    );
  }

  @override
  bool operator == (Object other) =>
      identical(this, other) || other is Engineer &&
          id == other.id;


  @override
  int get hashCode => id.hashCode;

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'name': name,
    };
  }

}