import 'package:niogu_ecommerce_v1/core/enums/review_display_policy.dart';
import 'package:niogu_ecommerce_v1/core/enums/review_display_type.dart';
import 'package:niogu_ecommerce_v1/core/enums/stock_type.dart';

class ProductDetail {
  final ReviewDisplayType reviewDisplayType;
  final ReviewDisplayPolicy reviewDisplayPolicy;
  final ProductInfo productInfo;

  const ProductDetail({
    required this.reviewDisplayType,
    required this.reviewDisplayPolicy,
    required this.productInfo,
  });
}

class ProductInfo {
  final String id;
  final List<String> images;
  final String name;
  final bool hasVariant;
  final String unit;
  final List<ProductVariant> variants;
  final String? description;

  const ProductInfo({
    required this.id,
    required this.images,
    required this.name,
    required this.hasVariant,
    required this.unit,
    required this.variants,
    this.description,
  });
}

class ProductVariant {
  final String id;
  final String? image;
  final String name;
  final bool isProductVariant;
  final double sellingPrice;
  final StockType stockType;
  final double stock;
  final double totalSold;
  final List<ProductReview> reviews;

  const ProductVariant({
    required this.id,
    this.image,
    required this.name,
    required this.isProductVariant,
    required this.sellingPrice,
    required this.stockType,
    required this.stock,
    required this.totalSold,
    required this.reviews,
  }); 
}

class ProductReview {
  final String id;
  final String customerName;
  final int ratingCount;
  final String? comment;

  const ProductReview({
    required this.id,
    required this.customerName,
    required this.ratingCount,
    this.comment,
  });
}