class FilterModel {
  late int id;
  late String code;
  late String name;
  late List<FilterOption> options;
  late List<FilterOption> selectedOptions;

  FilterModel({
    required this.id,
    required this.code,
    required this.name,
    required this.options,
    required this.selectedOptions,
  });

  FilterModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    code = json['code'];
    name = json['name'];
    selectedOptions = [];
    options = <FilterOption>[];
    if (json['options'] != null) {
      json['options'].forEach((v) {
        options.add(new FilterOption.fromJson(v));
      });
    }
  }
}

class FilterOption {
  late int id;
  late String adminName;
  String? label;
  String? image;

  FilterOption({
    required this.id,
    required this.adminName,
    this.label,
    this.image,
  });

  FilterOption.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    adminName = json['admin_name'];
    label = json['label'];
    image = json['image'];
  }
}
