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


BreedingRecordEntity $BreedingRecordEntityFromJson(Map<String, dynamic> json) {
  final BreedingRecordEntity breedingRecordEntity = BreedingRecordEntity();
  final Id? id = jsonConvert.convert<Id>(json['id']);
  if (id != null) {
    breedingRecordEntity.id = id;
  }
  final String? unid = jsonConvert.convert<String>(json['unid']);
  if (unid != null) {
    breedingRecordEntity.unid = unid;
  }
  final String? cattleresumeId = jsonConvert.convert<String>(json['cattleresumeId']);
  if (cattleresumeId != null) {
    breedingRecordEntity.cattleresumeId = cattleresumeId;
  }
  final String? registrationNo = jsonConvert.convert<String>(json['registrationNo']);
  if (registrationNo != null) {
    breedingRecordEntity.registrationNo = registrationNo;
  }
  final String? individualNo = jsonConvert.convert<String>(json['individualNo']);
  if (individualNo != null) {
    breedingRecordEntity.individualNo = individualNo;
  }
  final String? raiseVarieties = jsonConvert.convert<String>(json['raiseVarieties']);
  if (raiseVarieties != null) {
    breedingRecordEntity.raiseVarieties = raiseVarieties;
  }
  final String? location = jsonConvert.convert<String>(json['location']);
  if (location != null) {
    breedingRecordEntity.location = location;
  }
  final String? breedingPlantId = jsonConvert.convert<String>(json['breedingPlantId']);
  if (breedingPlantId != null) {
    breedingRecordEntity.breedingPlantId = breedingPlantId;
  }
  final String? uploadStatus = jsonConvert.convert<String>(json['uploadStatus']);
  if (uploadStatus != null) {
    breedingRecordEntity.uploadStatus = uploadStatus;
  }
  final String? deptId = jsonConvert.convert<String>(json['deptId']);
  if (deptId != null) {
    breedingRecordEntity.deptId = deptId;
  }
  final String? searchValue = jsonConvert.convert<String>(json['searchValue']);
  if (searchValue != null) {
    breedingRecordEntity.searchValue = searchValue;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    breedingRecordEntity.createBy = createBy;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    breedingRecordEntity.createTime = createTime;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    breedingRecordEntity.updateBy = updateBy;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    breedingRecordEntity.updateTime = updateTime;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    breedingRecordEntity.remark = remark;
  }
  return breedingRecordEntity;
}

Map<String, dynamic> $BreedingRecordEntityToJson(BreedingRecordEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['unid'] = entity.unid;
  data['cattleresumeId'] = entity.cattleresumeId;
  data['registrationNo'] = entity.registrationNo;
  data['individualNo'] = entity.individualNo;
  data['raiseVarieties'] = entity.raiseVarieties;
  data['location'] = entity.location;
  data['breedingPlantId'] = entity.breedingPlantId;
  data['uploadStatus'] = entity.uploadStatus;
  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 BreedingRecordEntityExtension on BreedingRecordEntity {
  BreedingRecordEntity copyWith({
    Id? id,
    String? unid,
    String? cattleresumeId,
    String? registrationNo,
    String? individualNo,
    String? raiseVarieties,
    String? location,
    String? breedingPlantId,
    String? uploadStatus,
    String? deptId,
    String? searchValue,
    String? createBy,
    String? createTime,
    String? updateBy,
    String? updateTime,
    String? remark,
  }) {
    return BreedingRecordEntity()
      ..id = id ?? this.id
      ..unid = unid ?? this.unid
      ..cattleresumeId = cattleresumeId ?? this.cattleresumeId
      ..registrationNo = registrationNo ?? this.registrationNo
      ..individualNo = individualNo ?? this.individualNo
      ..raiseVarieties = raiseVarieties ?? this.raiseVarieties
      ..location = location ?? this.location
      ..breedingPlantId = breedingPlantId ?? this.breedingPlantId
      ..uploadStatus = uploadStatus ?? this.uploadStatus
      ..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;
  }
}