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

part 'reference_implementation.g.dart';

@JsonSerializable()
@collection
class ReferenceImplementation extends BaseEntity with EntityWithId {
  ReferenceImplementation();

  @JsonKey(name: 'Liste aller Maßnahmen')
  @Index()
  String? listOfMeasures;
  @JsonKey(name: 'Datum der Anlage')
  String? dateStart;
  @JsonKey(name: '06 Betriebsverzeichnis')
  List<IdValue>? businessDirectory;
  @JsonKey(name: '00 Maßnahmendatenbank')
  List<IdValue>? measures;
  @JsonKey(name: 'Größe in m²')
  int? areaSize;
  @JsonKey(name: 'Beschreibung')
  String? description;
  @JsonKey(name: 'Fotos')
  List<FilePart> images = [];
  @JsonKey(name: 'Gesamtkosten')
  String? costsTotal;
  @JsonKey(name: 'Link zum Geomarker')
  String? linkToGeo;
  @JsonKey(name: 'Status')
  IdValueColor? status;
  @JsonKey(name: 'Materialbezug ohne AmBiTo')
  bool externalOrder = false;
  @JsonKey(name: 'Anzahl Elemente')
  String? elementCount;
  @JsonKey(name: 'Bestellwert')
  String? orderValue;

  @JsonKey(name: 'Lieferung')
  String? shippingCosts;
  @JsonKey(name: 'Anlage')
  String? constructionCosts;
  @JsonKey(name: 'Sträucher Kosten')
  String? shrubsCosts;
  @JsonKey(name: 'Bäume Kosten')
  String? treeCosts;
  @JsonKey(name: 'Sträucher Pflanzkosten')
  String? shrubsPlantingCosts;
  @JsonKey(name: 'Bäume Pflanzkosten')
  String? treePlantingCosts;
  @JsonKey(name: 'Anzahl Sträucher')
  String? shrubsCount;
  @JsonKey(name: 'Anzahl Bäume')
  String? treeCount;
  @JsonKey(name: 'Anmerkung')
  String? note;
  @JsonKey(name: 'Bearbeitet von')
  IdValue? editedBy;

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

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