import 'package:boilerplate/domain/entities/product/product_favorite_data.dart';
import 'package:json_annotation/json_annotation.dart';

import 'get_product_list_res_model.dart';

part 'get_product_favorite_res_model.g.dart';

@JsonSerializable(createToJson: false)
class GetProductFavoriteResModel {
  final List<GetProductFavoriteResultModel> result;

  GetProductFavoriteResModel(this.result);

  factory GetProductFavoriteResModel.fromJson(json) =>
      _$GetProductFavoriteResModelFromJson(json);
}

@JsonSerializable(createToJson: false)
class GetProductFavoriteResultModel extends ProductFavoriteData {
  @JsonKey(name: 'product_id')
  final int productId;
  final GetProductListItemResModel product;

  GetProductFavoriteResultModel({
    required super.id,
    required this.productId,
    required this.product,
  }) : super(productId: productId, product: product);

  factory GetProductFavoriteResultModel.fromJson(json) =>
      _$GetProductFavoriteResultModelFromJson(json);
}
