import 'package:wisdom_cli/wisdom_cli.dart';

class FeeTypeModel extends WPickerEntity {
  String? id;
  String? identification;
  num? version;
  String? communityId;
  num? price;
  num? discount;
  String? unit;
  dynamic quantityParam;
  String? chargeFormula;
  dynamic ladderFormula;
  String? feeName;
  String? feeTypeId;
  String? feeType;
  String? chargeAssetSubject;
  String? judgeFormula;
  String? chargeAccuracy;
  String? countRetention;
  bool? chargeLadder;
  bool? prepay;
  bool? tempCharge;
  bool? enable;
  num? printSort;

  FeeTypeModel({
    this.id,
    this.identification,
    this.version,
    this.communityId,
    this.price,
    this.discount,
    this.unit,
    this.quantityParam,
    this.chargeFormula,
    this.ladderFormula,
    this.feeName,
    this.feeTypeId,
    this.feeType,
    this.chargeAssetSubject,
    this.judgeFormula,
    this.chargeAccuracy,
    this.countRetention,
    this.chargeLadder,
    this.prepay,
    this.tempCharge,
    this.enable,
    this.printSort,
  });

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

    id = map['id'];
    identification = map['identification'];
    version = map['version'];
    communityId = map['communityId'];
    price = map['price'];
    discount = map['discount'];
    unit = map['unit'];
    quantityParam = map['quantityParam'];
    chargeFormula = map['chargeFormula'];
    ladderFormula = map['ladderFormula'];
    feeName = map['feeName'];
    feeTypeId = map['feeTypeId'];
    feeType = map['feeType'];
    chargeAssetSubject = map['chargeAssetSubject'];
    judgeFormula = map['judgeFormula'];
    chargeAccuracy = map['chargeAccuracy'];
    countRetention = map['countRetention'];
    chargeLadder = map['chargeLadder'];
    prepay = map['prepay'];
    tempCharge = map['tempCharge'];
    enable = map['enable'];
    printSort = map['printSort'];
  }

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

    json['id'] = this.id;
    json['identification'] = this.identification;
    json['version'] = this.version;
    json['communityId'] = this.communityId;
    json['price'] = this.price;
    json['discount'] = this.discount;
    json['unit'] = this.unit;
    json['quantityParam'] = this.quantityParam;
    json['chargeFormula'] = this.chargeFormula;
    json['ladderFormula'] = this.ladderFormula;
    json['feeName'] = this.feeName;
    json['feeTypeId'] = this.feeTypeId;
    json['feeType'] = this.feeType;
    json['chargeAssetSubject'] = this.chargeAssetSubject;
    json['judgeFormula'] = this.judgeFormula;
    json['chargeAccuracy'] = this.chargeAccuracy;
    json['countRetention'] = this.countRetention;
    json['chargeLadder'] = this.chargeLadder;
    json['prepay'] = this.prepay;
    json['tempCharge'] = this.tempCharge;
    json['enable'] = this.enable;
    json['printSort'] = this.printSort;

    return json;
  }

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

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

  @override
  bool get selectDisabled => false;
}
