import { Product, ProductCustomization } from '@/domain/entities';
import { ICartRepository } from '@/application/ports/ICartRepository';

/**
 * USE CASE — Add a product line to the cart (delegates merge logic to domain + repo)
 */
export class AddToCartUseCase {
  constructor(private readonly cart: ICartRepository) {}

  execute(
    product: Product,
    customization: ProductCustomization,
    customizationLabel: string,
    quantity = 1
  ): void {
    this.cart.addItem(product, customization, customizationLabel, quantity);
  }
}