/*
 * @Author: XianKaiQun
 * @Date: 2020-09-02 14:36:01
 * @LastEditors: ChenYaJin
 * @LastEditTime: 2022-11-21 10:30:20
 * @Description: 
 */
import 'package:wisdom_cli/wisdom_ui.dart';

class StatusModel implements WPickerEntity {
  String? code;
  String? name;
  bool? disabled;
  bool? show;
  String? quantity;

  StatusModel(
      {this.code,
      this.name,
      this.disabled = false,
      this.show = false,
      quantity = 0});

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

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

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

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

    return json;
  }

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

  @override
  get selectUnique => code ?? '';

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

class StatusStatistic {
  int? process;
  int? hangUp;

  StatusStatistic({
    this.process,
    this.hangUp,
  });

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

    process = map['process'];
    hangUp = map['hangUp'];
  }

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

    json['process'] = this.process;
    json['hangUp'] = this.hangUp;
    return json;
  }
}
