package com.example.demo.repository;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import com.example.demo.entity.Recipe;

public interface RecipeRepo extends JpaRepository<Recipe, Integer> {

	List<Recipe> findByTitleContainingIgnoreCase(String name);
	List<Recipe> findByTitleContainingIgnoreCaseAndTags_NameIn(String title, List<String> tags);
	
	long countByUserIdAndCreatedAtAfter(Integer userId, LocalDateTime after);

	List<Recipe> findByUserId(Integer userId);

}