package dev.fyloz.trial.colorrecipesexplorer.repository

import dev.fyloz.trial.colorrecipesexplorer.model.Company
import dev.fyloz.trial.colorrecipesexplorer.model.Recipe
import org.springframework.data.jpa.repository.JpaRepository

interface RecipeRepository : JpaRepository<Recipe, Long> {
    /** Checks if one or more recipes have the given [company]. */
    fun existsByCompany(company: Company): Boolean

    /** Gets all recipes with the given [company]. */
    fun findAllByCompany(company: Company): Collection<Recipe>
}
