/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-05-06 17:42:43
 * @LastEditTime : 2023-07-18 15:51:38
 * @Description  : Do not edit
 */

import 'package:wisdom_cli/wisdom_ui.dart';

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

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

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

    id = map['id'];
    name = map['name'];
    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 ?? false;
}
