import 'package:ambito/src/entity/_general/id_value/id_value.dart';
import 'package:ambito/src/entity/_general/id_value_color/id_value_color.dart';
import 'package:ambito/src/entity/base_entity.dart';
import 'package:isar/isar.dart';
import 'package:json_annotation/json_annotation.dart';

part 'approval_requirement.g.dart';

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

  @JsonKey(name: 'Name der Genehmigung')
  @Index()
  String? name;
  @JsonKey(name: 'Anmerkungen')
  String? notes;
  @JsonKey(name: 'Maßnahme')
  List<IdValue>? measures;
  @JsonKey(name: 'Behörde')
  List<IdValueColor>? authority;
  @JsonKey(name: 'Art der Genehmigung')
  List<IdValueColor>? typeOfApproval;

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

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