import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/response/fiance_report_entity.dart'; FianceReportEntity $FianceReportEntityFromJson(Map json) { final FianceReportEntity fianceReportEntity = FianceReportEntity(); final List? rateList = (json['rate_list'] as List?)?.map( (e) => jsonConvert.convert(e) as FianceReportRateList).toList(); if (rateList != null) { fianceReportEntity.rateList = rateList; } final int? requestTotal = jsonConvert.convert(json['request_total']); if (requestTotal != null) { fianceReportEntity.requestTotal = requestTotal; } final int? actualTotal = jsonConvert.convert(json['actual_total']); if (actualTotal != null) { fianceReportEntity.actualTotal = actualTotal; } return fianceReportEntity; } Map $FianceReportEntityToJson(FianceReportEntity entity) { final Map data = {}; data['rate_list'] = entity.rateList.map((v) => v.toJson()).toList(); data['request_total'] = entity.requestTotal; data['actual_total'] = entity.actualTotal; return data; } extension FianceReportEntityExtension on FianceReportEntity { FianceReportEntity copyWith({ List? rateList, int? requestTotal, int? actualTotal, }) { return FianceReportEntity() ..rateList = rateList ?? this.rateList ..requestTotal = requestTotal ?? this.requestTotal ..actualTotal = actualTotal ?? this.actualTotal; } } FianceReportRateList $FianceReportRateListFromJson(Map json) { final FianceReportRateList fianceReportRateList = FianceReportRateList(); final String? day = jsonConvert.convert(json['day']); if (day != null) { fianceReportRateList.day = day; } final String? weekNum = jsonConvert.convert(json['week_num']); if (weekNum != null) { fianceReportRateList.weekNum = weekNum; } final String? weekStr = jsonConvert.convert(json['week_str']); if (weekStr != null) { fianceReportRateList.weekStr = weekStr; } final int? request = jsonConvert.convert(json['request']); if (request != null) { fianceReportRateList.request = request; } final int? actual = jsonConvert.convert(json['actual']); if (actual != null) { fianceReportRateList.actual = actual; } final String? ratio = jsonConvert.convert(json['ratio']); if (ratio != null) { fianceReportRateList.ratio = ratio; } return fianceReportRateList; } Map $FianceReportRateListToJson(FianceReportRateList entity) { final Map data = {}; data['day'] = entity.day; data['week_num'] = entity.weekNum; data['week_str'] = entity.weekStr; data['request'] = entity.request; data['actual'] = entity.actual; data['ratio'] = entity.ratio; return data; } extension FianceReportRateListExtension on FianceReportRateList { FianceReportRateList copyWith({ String? day, String? weekNum, String? weekStr, int? request, int? actual, String? ratio, }) { return FianceReportRateList() ..day = day ?? this.day ..weekNum = weekNum ?? this.weekNum ..weekStr = weekStr ?? this.weekStr ..request = request ?? this.request ..actual = actual ?? this.actual ..ratio = ratio ?? this.ratio; } }