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

part 'item_filter.g.dart';

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

  String? type;
  @Index(composite: ['type'], unique: true, hash: true)
  String? name;
  @Index(composite: ['name'], unique: true, hash: true)
  String? url;
  String? description;
  String? image;
  String? color;
  List<int>? ids = [];

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

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