import 'package:boilerplate/domain/entities/categories/categories_data.dart';
import 'package:json_annotation/json_annotation.dart';

part 'get_categories_res_model.g.dart';

@JsonSerializable()
class GetCategoriesResModel {
  final List<GetCategoryItemResModel> result;

  GetCategoriesResModel(this.result);

  factory GetCategoriesResModel.fromJson(json) =>
      _$GetCategoriesResModelFromJson(json);

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

@JsonSerializable()
class GetCategoryItemResModel extends CategoriesData {
  GetCategoryItemResModel(
    super.id,
    super.parentId,
    super.name,
    super.code,
    super.link,
    super.detail,
    super.type,
    super.status,
    super.sortOrder,
    super.group,
    super.level,
    super.createdAt,
    super.updatedAt,
    super.cover,
  );

  factory GetCategoryItemResModel.fromJson(json) =>
      _$GetCategoryItemResModelFromJson(json);

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