/*
 * @Author: WuWei
 * @Date: 2020-07-21 18:48:55
 * @LastEditors: WuWei
 * @LastEditTime: 2020-07-21 18:49:08
 * @Description:
 */

import 'package:wisdom_cli/wisdom_ui.dart';

class ReportPersonListModel implements WPickerEntity {
  String? id;
  String? organName;
  String? name;
  String? phone;
  String? positionName;
  bool? disabled;

  ReportPersonListModel({
    this.id,
    this.organName,
    this.name,
    this.phone,
    this.positionName,
    this.disabled = false,
  });

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

    id = map['id'];
    organName = map['organName'];
    name = map['name'];
    phone = map['phone'];
    positionName = map['positionName'];
    disabled = map['disabled'] ?? this.disabled;
  }

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

    json['id'] = this.id;
    json['organName'] = this.organName;
    json['name'] = this.name;
    json['phone'] = this.phone;
    json['positionName'] = this.positionName;
    json['disabled'] = this.disabled;

    return json;
  }

  @override
  String get selectName => name ?? '';

  @override
  Object get selectUnique => id ?? '';

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