Skip to content
Snippets Groups Projects
Commit eec7d8dd authored by Stian Lyng Stræte's avatar Stian Lyng Stræte
Browse files

Merge branch 'feature/19-find-create-recipe-data' into 'main'

Feature/19 find create recipe data

See merge request idatt2106-v23-03/backend!18
parents 829d16ca 85d09a60
No related branches found
No related tags found
No related merge requests found
package ntnu.idatt2016.v233.SmartMat.repository;
import ntnu.idatt2016.v233.SmartMat.model.ShoppingList;
import ntnu.idatt2016.v233.SmartMat.model.product.Product;
import java.util.List;
......
package ntnu.idatt2016.v233.SmartMat.repository;
import java.util.List;
import java.util.Optional;
import ntnu.idatt2016.v233.SmartMat.model.Recipe;
/**
* This interface defines the methods for the recipe repository
*
* @author Stian Lyng
* @version 1.0
*/
public interface RecipeRepository {
/**
* Saves a recipe to the database
*
* @param recipe the recipe to save
*/
Recipe save (Recipe recipe);
/**
* Gets a recipe by its ID
*
* @param id the ID of the recipe
* @return an optional containing the recipe if it exists
*/
Optional<Recipe> getById(long id);
/**
* Gets a recipe by its name
* @param name the name of the recipe
* @return an optional containing the recipe if it exists
*/
Optional<Recipe> getByName(String name);
/**
* Gets all recipes
*
* @return an optional containing a list of all recipes
*/
Optional<List<Recipe>> getAll();
/**
* Deletes a recipe by its ID
*
* @param id the ID of the recipe
*/
void deleteById(int id);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment