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

part 'measure_category.g.dart';

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

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

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

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