package com.toyshop.repository;

import com.toyshop.entity.CartItem;
import com.toyshop.entity.User;
import com.toyshop.entity.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;

public interface CartItemRepository extends JpaRepository<CartItem, Long> {
  List<CartItem> findByUser(User user);
  Optional<CartItem> findByUserAndProduct(User user, Product product);
  void deleteByUser(User user);
}
