/*
 * @Author: XianKaiQun
 * @Date: 2020-08-18 15:52:34
 * @LastEditors: ,: XianKaiQun
 * @LastEditTime: ,: 2020-10-20 11:56:18
 * @Description: 
 */
import 'package:wisdom_cli/wisdom_ui.dart';

class CodeNameModel implements WPickerEntity {
  String? code;
  String? name;
  bool? disabled;

  CodeNameModel({
    this.code,
    this.name,
    this.disabled = false,
  });

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

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

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

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

    return json;
  }

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

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

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