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

part 'get_product_cart_res_model.g.dart';

@JsonSerializable(createToJson: false)
class GetProductCartResModel {
  @JsonKey(defaultValue: [])
  final List<GetProductCartResultModel> result;

  GetProductCartResModel(this.result);

  factory GetProductCartResModel.fromJson(json) =>
      _$GetProductCartResModelFromJson(json);
}

@JsonSerializable(createToJson: false)
class GetProductCartResultModel extends ProductCartData {
  @JsonKey(name: 'product_id')
  final int productId;

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

  factory GetProductCartResultModel.fromJson(json) =>
      _$GetProductCartResultModelFromJson(json);
}
