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

part 'funding_program.g.dart';

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

  @JsonKey(name: 'field_2402470')
  @Index()
  String? name;
  @JsonKey(name: 'field_2559837')
  List<IdValueColor>? region;
  @JsonKey(name: 'field_2402539')
  List<IdValue>? measureType;
  @JsonKey(name: 'field_2402788')
  String? fundingValue;
  @JsonKey(name: 'field_2402790')
  IdValueColor? fundingCalculation;
  @JsonKey(name: 'field_2402791')
  IdValueColor? fundingFrequency;
  @JsonKey(name: 'field_2999937')
  String? fundingFact;
  @JsonKey(name: 'field_2999876')
  String? fundingFramework;
  @JsonKey(name: 'field_2402792')
  bool? deMinimis;
  @JsonKey(name: 'field_2999741')
  String? source;
  @JsonKey(name: 'field_2999839')
  String? date;

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

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