/// Domain Entity: Category
///
/// Pure business entity representing a product category.
library;

/// Category Entity
///
/// Represents a product category for filtering and organization.
class Category {
  /// Unique identifier
  final String id;

  /// Category name (Vietnamese)
  final String name;

  /// Category description
  final String description;

  /// Icon name or emoji
  final String icon;

  /// Display order
  final int order;

  const Category({
    required this.id,
    required this.name,
    required this.description,
    required this.icon,
    required this.order,
  });

  /// Copy with method
  Category copyWith({
    String? id,
    String? name,
    String? description,
    String? icon,
    int? order,
  }) {
    return Category(
      id: id ?? this.id,
      name: name ?? this.name,
      description: description ?? this.description,
      icon: icon ?? this.icon,
      order: order ?? this.order,
    );
  }

  @override
  String toString() {
    return 'Category(id: $id, name: $name, order: $order)';
  }

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

    return other is Category &&
        other.id == id &&
        other.name == name &&
        other.description == description &&
        other.icon == icon &&
        other.order == order;
  }

  @override
  int get hashCode {
    return Object.hash(id, name, description, icon, order);
  }
}
