import 'package:ambito/src/entity/entities.dart';
import 'package:isar/isar.dart';
import 'package:json_annotation/json_annotation.dart';

part 'measure_details.g.dart';

@collection
@JsonSerializable(explicitToJson: true)
class MeasureDetails extends BaseEntity with EntityWithId {
  MeasureDetails();

  @JsonKey(name: 'field_3050771')
  @Index()
  String? name;
  @JsonKey(name: 'field_2532842')
  String? type;
  @JsonKey(name: 'field_3001704')
  List<IdValue>? measure;
  @JsonKey(name: 'field_3024913')
  List<IdValue>? measureType;
  @JsonKey(name: 'field_3050682')
  List<IdValueMix>? measureGroup;
  @JsonKey(name: 'field_2532841')
  String? germanTitle;

  @JsonKey(name: 'field_2532843')
  String? heightMin;
  @JsonKey(name: 'field_2532844')
  String? heightMax;
  @JsonKey(name: 'field_2532845')
  List<IdValueColor>? lifeForm;
  @JsonKey(name: 'field_2532846')
  List<IdValueColor>? growth;
  @JsonKey(name: 'field_2532847')
  List<IdValueColor>? climate;
  @JsonKey(name: 'field_2532848')
  IdValueColor? riskOfSpottedWingDrosophila;
  @JsonKey(name: 'field_2532849')
  IdValueColor? thermophilic;
  @JsonKey(name: 'field_2532850')
  IdValueColor? frostHardy;
  @JsonKey(name: 'field_2532851')
  IdValueColor? lateFrost;
  @JsonKey(name: 'field_2532852')
  IdValueColor? drought;
  @JsonKey(name: 'field_2532853')
  String? soilWater;
  @JsonKey(name: 'field_2532854')
  List<IdValueColor>? soilMoisture;
  @JsonKey(name: 'field_2532855')
  String? numberLight;
  @JsonKey(name: 'field_2532856')
  String? numberTemperature;
  @JsonKey(name: 'field_2532857')
  String? numberMoisture;
  @JsonKey(name: 'field_2532858')
  String? numberReaction;
  @JsonKey(name: 'field_2532859')
  String? numberNitrogen;
  @JsonKey(name: 'field_2532860')
  List<IdValueColor>? region;
  @JsonKey(name: 'field_2532861')
  String? reminder;
  @JsonKey(name: 'field_2546419')
  IdValueColor? native;
  @JsonKey(name: 'field_2532863')
  IdValueColor? wildOrCulturedForm;
  @JsonKey(name: 'field_2532840')
  String? id2;
  @JsonKey(name: 'field_3056040')
  List<IdValue>? referenceImplementation;
  @JsonKey(name: 'field_3056088')
  List<IdValue>? referenceImplementation2;

  factory MeasureDetails.fromJson(Map<String, dynamic> json) =>
      _$MeasureDetailsFromJson(json);

  Map<String, dynamic> toJson() => _$MeasureDetailsToJson(this);
}
