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


ImmuneBatchDetailEntity $ImmuneBatchDetailEntityFromJson(Map<String, dynamic> json) {
  final ImmuneBatchDetailEntity immuneBatchDetailEntity = ImmuneBatchDetailEntity();
  final Id? id = jsonConvert.convert<Id>(json['id']);
  if (id != null) {
    immuneBatchDetailEntity.id = id;
  }
  final String? unid = jsonConvert.convert<String>(json['unid']);
  if (unid != null) {
    immuneBatchDetailEntity.unid = unid;
  }
  final String? cattleresumeUnid = jsonConvert.convert<String>(json['cattleresumeUnid']);
  if (cattleresumeUnid != null) {
    immuneBatchDetailEntity.cattleresumeUnid = cattleresumeUnid;
  }
  final String? registrationNo = jsonConvert.convert<String>(json['registrationNo']);
  if (registrationNo != null) {
    immuneBatchDetailEntity.registrationNo = registrationNo;
  }
  final String? individualNo = jsonConvert.convert<String>(json['individualNo']);
  if (individualNo != null) {
    immuneBatchDetailEntity.individualNo = individualNo;
  }
  final String? immunebatchUnid = jsonConvert.convert<String>(json['immunebatchUnid']);
  if (immunebatchUnid != null) {
    immuneBatchDetailEntity.immunebatchUnid = immunebatchUnid;
  }
  final String? deptId = jsonConvert.convert<String>(json['deptId']);
  if (deptId != null) {
    immuneBatchDetailEntity.deptId = deptId;
  }
  final String? uploadStatus = jsonConvert.convert<String>(json['uploadStatus']);
  if (uploadStatus != null) {
    immuneBatchDetailEntity.uploadStatus = uploadStatus;
  }
  return immuneBatchDetailEntity;
}

Map<String, dynamic> $ImmuneBatchDetailEntityToJson(ImmuneBatchDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['unid'] = entity.unid;
  data['cattleresumeUnid'] = entity.cattleresumeUnid;
  data['registrationNo'] = entity.registrationNo;
  data['individualNo'] = entity.individualNo;
  data['immunebatchUnid'] = entity.immunebatchUnid;
  data['deptId'] = entity.deptId;
  data['uploadStatus'] = entity.uploadStatus;
  return data;
}

extension ImmuneBatchDetailEntityExtension on ImmuneBatchDetailEntity {
  ImmuneBatchDetailEntity copyWith({
    Id? id,
    String? unid,
    String? cattleresumeUnid,
    String? registrationNo,
    String? individualNo,
    String? immunebatchUnid,
    String? deptId,
    String? uploadStatus,
  }) {
    return ImmuneBatchDetailEntity()
      ..id = id ?? this.id
      ..unid = unid ?? this.unid
      ..cattleresumeUnid = cattleresumeUnid ?? this.cattleresumeUnid
      ..registrationNo = registrationNo ?? this.registrationNo
      ..individualNo = individualNo ?? this.individualNo
      ..immunebatchUnid = immunebatchUnid ?? this.immunebatchUnid
      ..deptId = deptId ?? this.deptId
      ..uploadStatus = uploadStatus ?? this.uploadStatus;
  }
}