/*
 * @Author: WuXiangNan
 * @Date: 2021-05-27 08:52:16
 * @LastEditors: WuXiangNan
 * @LastEditTime: 2021-08-06 11:05:12
 * @Description: 客户服务数据
 */
import 'package:business_package/src/models/serve_data/repair.dart';
import 'package:business_package/src/models/serve_data/source.dart';

class ServeData {
  List<RepairReportEntity>? report;
  List<RepairReportEntity>? repair;
  String? solveRatio;
  Source? source;
  int? serviceNewsCount;
  int? serviceNewsUpCount;
  int? noticeCount;
  int? noticeReadCount;
  int? serviceEvaluationCount;
  String? serviceEvaluationAvgScore;
  int? ownerScoreCount;
  String? cleanOwnerAvgScore;
  String? ownerAvgScore;
  String? orderOwnerAvgScore;
  String? deviceOwnerAvgScore;
  String? greenOwnerAvgScore;
  String? intelligentOwnerAvgScore;

  ServeData(
      {this.report,
      this.repair,
      this.solveRatio,
      this.source,
      this.serviceEvaluationCount,
      this.serviceNewsUpCount,
      this.noticeCount,
      this.noticeReadCount,
      this.serviceNewsCount,
      this.serviceEvaluationAvgScore,
      this.ownerScoreCount,
      this.orderOwnerAvgScore,
      this.ownerAvgScore,
      this.cleanOwnerAvgScore,
      this.deviceOwnerAvgScore,
      this.greenOwnerAvgScore,
      this.intelligentOwnerAvgScore});

  ServeData.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});
    report = List<RepairReportEntity>.from(
        (map['report'] ?? []).map((x) => RepairReportEntity.fromJson(x)));
    repair = List<RepairReportEntity>.from(
        (map['repair'] ?? []).map((x) => RepairReportEntity.fromJson(x)));
    solveRatio = map['solveRatio'];
    source = Source.fromJson(map['source'] ?? {});
    serviceEvaluationCount = map['serviceEvaluationCount'];
    serviceNewsUpCount = map['serviceNewsUpCount'];
    noticeCount = map['noticeCount'];
    noticeReadCount = map['noticeReadCount'];
    serviceNewsCount = map['serviceNewsCount'];
    serviceEvaluationAvgScore = map['serviceEvaluationAvgScore'];
    ownerScoreCount = map['ownerScoreCount'];
    orderOwnerAvgScore = map['orderOwnerAvgScore'];
    ownerAvgScore = map['ownerAvgScore'];
    cleanOwnerAvgScore = map['cleanOwnerAvgScore'];
    deviceOwnerAvgScore = map['deviceOwnerAvgScore'];
    greenOwnerAvgScore = map['greenOwnerAvgScore'];
    intelligentOwnerAvgScore = map['intelligentOwnerAvgScore'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();
    json['report'] =
        List<RepairReportEntity>.from(this.report ?? []).map((x) => x.toJson());
    json['repair'] =
        List<RepairReportEntity>.from(this.repair ?? []).map((x) => x.toJson());
    json['solveRatio'] = this.solveRatio;
    json['source'] = this.source!.toJson();
    json['serviceEvaluationCount'] = this.serviceEvaluationCount;
    json['serviceNewsUpCount'] = this.serviceNewsUpCount;
    json['noticeCount'] = this.noticeCount;
    json['noticeReadCount'] = this.noticeReadCount;
    json['serviceNewsCount'] = this.serviceNewsCount;
    json['serviceEvaluationAvgScore'] = this.serviceEvaluationAvgScore;
    json['ownerScoreCount'] = this.ownerScoreCount;
    json['orderOwnerAvgScore'] = this.orderOwnerAvgScore;
    json['ownerAvgScore'] = this.ownerAvgScore;
    json['cleanOwnerAvgScore'] = this.cleanOwnerAvgScore;
    json['deviceOwnerAvgScore'] = this.deviceOwnerAvgScore;
    json['greenOwnerAvgScore'] = this.greenOwnerAvgScore;
    json['intelligentOwnerAvgScore'] = this.intelligentOwnerAvgScore;

    return json;
  }
}
