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

class ProductData {
  final int? id;
  @JsonKey(name: 'url_code')
  final String? urlCode;
  final String? name;
  final String? cover;
  final String? excerpt;
  final String? detail;
  final String? price;
  @JsonKey(name: 'special_price')
  final dynamic specialPrice;
  final String? sku;
  final double? tax;
  final int? quantity;
  final double? size;
  final String? visibility;
  @JsonKey(name: 'news_from_date')
  final String? newsFromDate;
  @JsonKey(name: 'news_to_date')
  final String? newsToDate;
  final String? layout;
  final String? theme;
  final String? duration;
  @JsonKey(name: 'selling_start_time')
  final String? sellingStartTime;
  @JsonKey(name: 'selling_end_time')
  final String? sellingEndTime;
  @JsonKey(name: 'redemption_start_time')
  final String? redemptionStartTime;
  @JsonKey(name: 'redemption_end_time')
  final String? redemptionEndTime;
  final String? availibility;
  @JsonKey(name: 'is_featured')
  final String? isFeatured;
  @JsonKey(name: 'is_deal')
  final String? isDeal;
  @JsonKey(name: 'review_status')
  final String? reviewStatus;
  @JsonKey(name: 'related_status')
  final String? relatedStatus;
  @JsonKey(name: 'up_sells_status')
  final String? upSellsStatus;
  @JsonKey(name: 'cross_sells_status')
  final String? crossSellsStatus;
  @JsonKey(name: 'allow_gift_message')
  final String? allowGiftMessage;
  @JsonKey(name: 'stock_status')
  final String? stockStatus;
  final String? status;
  final double? dimension;
  final int? groupId;
  final String? tags;
  @JsonKey(name: 'attribute_set')
  final String? attributeSet;
  @JsonKey(name: 'vendor_id')
  final int? vendorId;
  @JsonKey(name: 'allow_route')
  final String? allowRoute;
  final String? type;
  @JsonKey(name: 'created_at')
  final String? createdAt;
  @JsonKey(name: 'update_at')
  final String? updatedAt;
  @JsonKey(name: 'created_dete')
  final String? createdDate;
  @JsonKey(name: 'updated_date')
  final String? updatedDate;
  @JsonKey(name: 'create_by')
  final int? createBy;
  @JsonKey(name: 'updated_by')
  final String? updatedBy;
  @JsonKey(name: 'group_data')
  final String? groupData;
  final String? address;
  @JsonKey(name: 'industry_group')
  final String? industryGroup;
  @JsonKey(name: 'objective_sale')
  final String? objectiveSale;
  @JsonKey(name: 'store_id')
  final int? storeId;
  final String? location;
  final String? target;

  // final List<ProductDipRegisInfoData>? dipRegisInfo;

  final List<ProductImageData>? images;
  final ProductStoreData? store;
  final List<CategoriesData>? category;
  final IntellectualTypeData? intellectualType;
  @JsonKey(name: 'contract_type')
  final String? contractType;
  final List<ProductRelateData> relateData;

  ProductData({
    this.id,
    this.urlCode,
    this.name,
    this.cover,
    this.excerpt,
    this.detail,
    this.price,
    this.specialPrice,
    this.sku,
    this.tax,
    this.quantity,
    this.size,
    this.visibility,
    this.newsFromDate,
    this.newsToDate,
    this.layout,
    this.theme,
    this.duration,
    this.sellingStartTime,
    this.sellingEndTime,
    this.redemptionStartTime,
    this.redemptionEndTime,
    this.availibility,
    this.isFeatured,
    this.isDeal,
    this.reviewStatus,
    this.relatedStatus,
    this.upSellsStatus,
    this.crossSellsStatus,
    this.allowGiftMessage,
    this.stockStatus,
    this.status,
    this.dimension,
    this.groupId,
    this.tags,
    this.attributeSet,
    this.vendorId,
    this.allowRoute,
    this.type,
    this.createdAt,
    this.updatedAt,
    this.createdDate,
    this.updatedDate,
    this.createBy,
    this.updatedBy,
    this.groupData,
    this.address,
    this.industryGroup,
    this.objectiveSale,
    this.storeId,
    this.location,
    this.target,
    // this.dipRegisInfo,
    this.images,
    this.store,
    this.category,
    this.intellectualType,
    this.contractType,
    this.relateData = const [],
  });
}

class ProductImageData {
  @JsonKey(name: 'target_link')
  final String link;

  ProductImageData(this.link);
}


// class ProductDipRegisInfoData {
//
//    final String? requestNumber;
//    final String? requestDate;
//    final String? expireDate;
//    final String? name;
//    final String? requestName;
//    final String? addressOfRequestName;
//    final String? certificateNumber;
//    final String? certificateDate;
//   ProductDipRegisInfoData(this.requestNumber, this.requestDate, this.expireDate,this.name,this.requestName,this.addressOfRequestName,this.certificateNumber,this.certificateDate);
//
//
// }

class ProductStoreData {
  final int id;
  final String? email;
  final String? phone;

  ProductStoreData(this.email, this.phone, this.id);
}

class ProductRelateData {
  final int id;
  @JsonKey(name: 'url_code')
  final String? urlCode;
  final String? name;
  final String? cover;

  ProductRelateData(this.id, this.urlCode, this.name, this.cover);
}
