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

part 'get_product_list_res_model.g.dart';

@JsonSerializable(createToJson: false)
class GetProductListResModel {
  final GetProductListResultResModel result;

  GetProductListResModel(this.result);

  factory GetProductListResModel.fromJson(json) =>
      _$GetProductListResModelFromJson(json);
}

@JsonSerializable(createToJson: false)
class GetProductListResultResModel {
  final List<GetProductListItemResModel> data;

  GetProductListResultResModel(this.data);

  factory GetProductListResultResModel.fromJson(json) =>
      _$GetProductListResultResModelFromJson(json);
}

@JsonSerializable(createToJson: false)
class GetProductListItemResModel extends ProductData {
  GetProductListItemResModel({
    super.id,
    super.urlCode,
    super.name,
    super.cover,
    super.excerpt,
    super.detail,
    super.price,
    super.specialPrice,
    super.sku,
    super.tax,
    super.quantity,
    super.size,
    super.visibility,
    super.newsFromDate,
    super.newsToDate,
    super.layout,
    super.theme,
    super.duration,
    super.sellingStartTime,
    super.sellingEndTime,
    super.redemptionStartTime,
    super.redemptionEndTime,
    super.availibility,
    super.isFeatured,
    super.isDeal,
    super.reviewStatus,
    super.relatedStatus,
    super.upSellsStatus,
    super.crossSellsStatus,
    super.allowGiftMessage,
    super.stockStatus,
    super.status,
    super.dimension,
    super.groupId,
    super.tags,
    super.attributeSet,
    super.vendorId,
    super.allowRoute,
    super.type,
    super.createdAt,
    super.updatedAt,
    super.createdDate,
    super.updatedDate,
    super.createBy,
    super.updatedBy,
    super.groupData,
    super.address,
    super.industryGroup,
    super.objectiveSale,
    super.storeId,
    super.location,
    super.target,
    // super.dipRegisInfo,
    List<GetProductImagesResModel>? images,
  }) : super(
          images: images,
        );

  factory GetProductListItemResModel.fromJson(json) =>
      _$GetProductListItemResModelFromJson(json);
}

@JsonSerializable(createToJson: false)
class GetProductImagesResModel extends ProductImageData {
  GetProductImagesResModel(super.link);

  factory GetProductImagesResModel.fromJson(json) =>
      _$GetProductImagesResModelFromJson(json);
}
