/// Domain Entity: Showroom Product
///
/// Represents a product used in a showroom display.
library;

/// Showroom Product Entity
///
/// Contains information about a product featured in a showroom:
/// - Product reference
/// - Quantity used
/// - Showroom context
class ShowroomProduct {
  /// Showroom ID
  final String showroomId;

  /// Product ID
  final String productId;

  /// Quantity of product used in the showroom
  final double quantityUsed;

  const ShowroomProduct({
    required this.showroomId,
    required this.productId,
    required this.quantityUsed,
  });

  /// Copy with method for immutability
  ShowroomProduct copyWith({
    String? showroomId,
    String? productId,
    double? quantityUsed,
  }) {
    return ShowroomProduct(
      showroomId: showroomId ?? this.showroomId,
      productId: productId ?? this.productId,
      quantityUsed: quantityUsed ?? this.quantityUsed,
    );
  }

  @override
  bool operator ==(Object other) {
    if (identical(this, other)) return true;

    return other is ShowroomProduct &&
        other.showroomId == showroomId &&
        other.productId == productId &&
        other.quantityUsed == quantityUsed;
  }

  @override
  int get hashCode {
    return Object.hash(showroomId, productId, quantityUsed);
  }

  @override
  String toString() {
    return 'ShowroomProduct(showroomId: $showroomId, productId: $productId, '
        'quantityUsed: $quantityUsed)';
  }
}
