Potion/internal/domain/recipe/repository.go
Hayden Hargreaves 045dc13fbe (FEAT): Created favorites search route which allows for better search.
This basically marks the favorites page completed. Updating the recipe
repository to allow the search function to accept a userId and favorites
flag. This flag will toggle a "favorites only" search. Which can be used
to replicate the same functionality from the search page in the
favorites page. This later can serve as a baseline for updating to also
work for activity search.

I am starting to think an ORM is a good idea...I heard Gorm is good, but
for now, there is a bit too much tech debt.
2025-07-16 18:57:36 -07:00

13 lines
458 B
Go

package domain
type RecipeRepository interface {
CreateRecipe(recipe *Recipe) error
GetRecipe(id int, userId *int) (*Recipe, error)
SearchRecipes(filters SearchFilters, userId *int, favorites bool) ([]Recipe, error)
CreateRecipeTags(recipe Recipe, tags []string) error
GetUserRecipes(id int) ([]Recipe, error)
GetUserFavoriteRecipes(id int) ([]Recipe, error)
GetRecipeTags(recipe *Recipe) error
GetRecipeFavorite(recipe *Recipe, userId int) error
}