import 'package:test_sa/models/base.dart';

class TaskType extends Base {
  int? id;
  String? taskTypeName;

  TaskType({this.id, this.taskTypeName}) : super(identifier: id?.toString(), name: taskTypeName);

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

  @override
  int get hashCode => id.hashCode;

  Map<String, dynamic> toJson() {
    return {"id": id, "taskTypeName": taskTypeName};
  }

  factory TaskType.fromJson(Map<String, dynamic>? parsedJson) {
    if (parsedJson == null) return TaskType();
    return TaskType(
      id: parsedJson["id"],
      taskTypeName: parsedJson["taskTypeName"],
    );
  }
}
