import 'package:wisdom_cli/new/widgets/picker.dart';

class TypeIdModel implements WPickerEntity {
  String? id;
  String? name;
  bool? disabled;

  TypeIdModel({
    this.id,
    this.name,
    this.disabled = false,
  });

  TypeIdModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    name = map['type'];
    disabled = map['disabled'] ?? this.disabled;
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['name'] = this.name;
    json['disabled'] = this.disabled;

    return json;
  }

  @override
  String get selectName => this.name!;

  @override
  Object get selectUnique => this.id!;

  @override
  bool get selectDisabled => this.disabled!;
}
