import 'package:anchor_collect_flutter/generated/json/base/json_convert_content.dart';
import 'package:anchor_collect_flutter/models/weight_man_entity.dart';
import 'package:isar/isar.dart';


WeightManEntity $WeightManEntityFromJson(Map<String, dynamic> json) {
  final WeightManEntity weightManEntity = WeightManEntity();
  final Id? id = jsonConvert.convert<Id>(json['id']);
  if (id != null) {
    weightManEntity.id = id;
  }
  final String? unid = jsonConvert.convert<String>(json['unid']);
  if (unid != null) {
    weightManEntity.unid = unid;
  }
  final String? cattleresumeId = jsonConvert.convert<String>(json['cattleresumeId']);
  if (cattleresumeId != null) {
    weightManEntity.cattleresumeId = cattleresumeId;
  }
  final double? weight = jsonConvert.convert<double>(json['weight']);
  if (weight != null) {
    weightManEntity.weight = weight;
  }
  final String? wTime = jsonConvert.convert<String>(json['wTime']);
  if (wTime != null) {
    weightManEntity.wTime = wTime;
  }
  final String? uploadStatus = jsonConvert.convert<String>(json['uploadStatus']);
  if (uploadStatus != null) {
    weightManEntity.uploadStatus = uploadStatus;
  }
  final String? registrationNo = jsonConvert.convert<String>(json['registrationNo']);
  if (registrationNo != null) {
    weightManEntity.registrationNo = registrationNo;
  }
  final String? individualNo = jsonConvert.convert<String>(json['individualNo']);
  if (individualNo != null) {
    weightManEntity.individualNo = individualNo;
  }
  final String? deptId = jsonConvert.convert<String>(json['deptId']);
  if (deptId != null) {
    weightManEntity.deptId = deptId;
  }
  final String? searchValue = jsonConvert.convert<String>(json['searchValue']);
  if (searchValue != null) {
    weightManEntity.searchValue = searchValue;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    weightManEntity.createBy = createBy;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    weightManEntity.createTime = createTime;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    weightManEntity.updateBy = updateBy;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    weightManEntity.updateTime = updateTime;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    weightManEntity.remark = remark;
  }
  return weightManEntity;
}

Map<String, dynamic> $WeightManEntityToJson(WeightManEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['unid'] = entity.unid;
  data['cattleresumeId'] = entity.cattleresumeId;
  data['weight'] = entity.weight;
  data['wTime'] = entity.wTime;
  data['uploadStatus'] = entity.uploadStatus;
  data['registrationNo'] = entity.registrationNo;
  data['individualNo'] = entity.individualNo;
  data['deptId'] = entity.deptId;
  data['searchValue'] = entity.searchValue;
  data['createBy'] = entity.createBy;
  data['createTime'] = entity.createTime;
  data['updateBy'] = entity.updateBy;
  data['updateTime'] = entity.updateTime;
  data['remark'] = entity.remark;
  return data;
}

extension WeightManEntityExtension on WeightManEntity {
  WeightManEntity copyWith({
    Id? id,
    String? unid,
    String? cattleresumeId,
    double? weight,
    String? wTime,
    String? uploadStatus,
    String? registrationNo,
    String? individualNo,
    String? deptId,
    String? searchValue,
    String? createBy,
    String? createTime,
    String? updateBy,
    String? updateTime,
    String? remark,
  }) {
    return WeightManEntity()
      ..id = id ?? this.id
      ..unid = unid ?? this.unid
      ..cattleresumeId = cattleresumeId ?? this.cattleresumeId
      ..weight = weight ?? this.weight
      ..wTime = wTime ?? this.wTime
      ..uploadStatus = uploadStatus ?? this.uploadStatus
      ..registrationNo = registrationNo ?? this.registrationNo
      ..individualNo = individualNo ?? this.individualNo
      ..deptId = deptId ?? this.deptId
      ..searchValue = searchValue ?? this.searchValue
      ..createBy = createBy ?? this.createBy
      ..createTime = createTime ?? this.createTime
      ..updateBy = updateBy ?? this.updateBy
      ..updateTime = updateTime ?? this.updateTime
      ..remark = remark ?? this.remark;
  }
}