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

part 'measure_type.g.dart';

@collection
@JsonSerializable(explicitToJson: true)
class MeasureType extends BaseEntity with EntityWithIdAndName {
  MeasureType();

  @Index()
  String? url;
  String? image;
  String? description;
  String? measureGroup;
  List<String>? measureCategories;
  List<int> ids = [];
  int children = 0;

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

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