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


BreedingRecordDetailEntity $BreedingRecordDetailEntityFromJson(Map<String, dynamic> json) {
  final BreedingRecordDetailEntity breedingRecordDetailEntity = BreedingRecordDetailEntity();
  final Id? id = jsonConvert.convert<Id>(json['id']);
  if (id != null) {
    breedingRecordDetailEntity.id = id;
  }
  final String? unid = jsonConvert.convert<String>(json['unid']);
  if (unid != null) {
    breedingRecordDetailEntity.unid = unid;
  }
  final String? fUnid = jsonConvert.convert<String>(json['fUnid']);
  if (fUnid != null) {
    breedingRecordDetailEntity.fUnid = fUnid;
  }
  final String? matingStyle = jsonConvert.convert<String>(json['matingStyle']);
  if (matingStyle != null) {
    breedingRecordDetailEntity.matingStyle = matingStyle;
  }
  final String? cattleresumeId = jsonConvert.convert<String>(json['cattleresumeId']);
  if (cattleresumeId != null) {
    breedingRecordDetailEntity.cattleresumeId = cattleresumeId;
  }
  final String? registrationNo = jsonConvert.convert<String>(json['registrationNo']);
  if (registrationNo != null) {
    breedingRecordDetailEntity.registrationNo = registrationNo;
  }
  final String? individualNo = jsonConvert.convert<String>(json['individualNo']);
  if (individualNo != null) {
    breedingRecordDetailEntity.individualNo = individualNo;
  }
  final String? frozenSemenBatch = jsonConvert.convert<String>(json['frozenSemenBatch']);
  if (frozenSemenBatch != null) {
    breedingRecordDetailEntity.frozenSemenBatch = frozenSemenBatch;
  }
  final String? matingDate = jsonConvert.convert<String>(json['matingDate']);
  if (matingDate != null) {
    breedingRecordDetailEntity.matingDate = matingDate;
  }
  final String? isReturn = jsonConvert.convert<String>(json['isReturn']);
  if (isReturn != null) {
    breedingRecordDetailEntity.isReturn = isReturn;
  }
  final String? backLoveDate = jsonConvert.convert<String>(json['backLoveDate']);
  if (backLoveDate != null) {
    breedingRecordDetailEntity.backLoveDate = backLoveDate;
  }
  final String? dueDate = jsonConvert.convert<String>(json['dueDate']);
  if (dueDate != null) {
    breedingRecordDetailEntity.dueDate = dueDate;
  }
  final String? pregnancy = jsonConvert.convert<String>(json['pregnancy']);
  if (pregnancy != null) {
    breedingRecordDetailEntity.pregnancy = pregnancy;
  }
  final String? deptId = jsonConvert.convert<String>(json['deptId']);
  if (deptId != null) {
    breedingRecordDetailEntity.deptId = deptId;
  }
  final String? caId = jsonConvert.convert<String>(json['caId']);
  if (caId != null) {
    breedingRecordDetailEntity.caId = caId;
  }
  final String? uploadStatus = jsonConvert.convert<String>(json['uploadStatus']);
  if (uploadStatus != null) {
    breedingRecordDetailEntity.uploadStatus = uploadStatus;
  }
  final String? searchValue = jsonConvert.convert<String>(json['searchValue']);
  if (searchValue != null) {
    breedingRecordDetailEntity.searchValue = searchValue;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    breedingRecordDetailEntity.createBy = createBy;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    breedingRecordDetailEntity.createTime = createTime;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    breedingRecordDetailEntity.updateBy = updateBy;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    breedingRecordDetailEntity.updateTime = updateTime;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    breedingRecordDetailEntity.remark = remark;
  }
  return breedingRecordDetailEntity;
}

Map<String, dynamic> $BreedingRecordDetailEntityToJson(BreedingRecordDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['unid'] = entity.unid;
  data['fUnid'] = entity.fUnid;
  data['matingStyle'] = entity.matingStyle;
  data['cattleresumeId'] = entity.cattleresumeId;
  data['registrationNo'] = entity.registrationNo;
  data['individualNo'] = entity.individualNo;
  data['frozenSemenBatch'] = entity.frozenSemenBatch;
  data['matingDate'] = entity.matingDate;
  data['isReturn'] = entity.isReturn;
  data['backLoveDate'] = entity.backLoveDate;
  data['dueDate'] = entity.dueDate;
  data['pregnancy'] = entity.pregnancy;
  data['deptId'] = entity.deptId;
  data['caId'] = entity.caId;
  data['uploadStatus'] = entity.uploadStatus;
  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 BreedingRecordDetailEntityExtension on BreedingRecordDetailEntity {
  BreedingRecordDetailEntity copyWith({
    Id? id,
    String? unid,
    String? fUnid,
    String? matingStyle,
    String? cattleresumeId,
    String? registrationNo,
    String? individualNo,
    String? frozenSemenBatch,
    String? matingDate,
    String? isReturn,
    String? backLoveDate,
    String? dueDate,
    String? pregnancy,
    String? deptId,
    String? caId,
    String? uploadStatus,
    String? searchValue,
    String? createBy,
    String? createTime,
    String? updateBy,
    String? updateTime,
    String? remark,
  }) {
    return BreedingRecordDetailEntity()
      ..id = id ?? this.id
      ..unid = unid ?? this.unid
      ..fUnid = fUnid ?? this.fUnid
      ..matingStyle = matingStyle ?? this.matingStyle
      ..cattleresumeId = cattleresumeId ?? this.cattleresumeId
      ..registrationNo = registrationNo ?? this.registrationNo
      ..individualNo = individualNo ?? this.individualNo
      ..frozenSemenBatch = frozenSemenBatch ?? this.frozenSemenBatch
      ..matingDate = matingDate ?? this.matingDate
      ..isReturn = isReturn ?? this.isReturn
      ..backLoveDate = backLoveDate ?? this.backLoveDate
      ..dueDate = dueDate ?? this.dueDate
      ..pregnancy = pregnancy ?? this.pregnancy
      ..deptId = deptId ?? this.deptId
      ..caId = caId ?? this.caId
      ..uploadStatus = uploadStatus ?? this.uploadStatus
      ..searchValue = searchValue ?? this.searchValue
      ..createBy = createBy ?? this.createBy
      ..createTime = createTime ?? this.createTime
      ..updateBy = updateBy ?? this.updateBy
      ..updateTime = updateTime ?? this.updateTime
      ..remark = remark ?? this.remark;
  }
}