
using Models;
using System.Collections.Immutable;

namespace LocalEndpoint.Data
{

    // The database interface defines all the different kinds of requests the LocalEndpoint needs to store and retrieve data.
    public interface Database
    {

        public Recipe GetRecipe(Guid id);

        public RecipeRate GetRecipeRate(Guid user, Guid recipe);

        public Account? GetAccount(string email, string passwordHash);

        public void InsertInUserList(Guid userId, Guid recipeId, uint persAmount);
        public void RemoveFromUserList(Guid userId, Guid recipeId);
        public void InsertAccount(Account account, string passwordHash);

        public void InsertRecipe(Recipe recipe);

        public void InsertUser(User user);

        public void InsertRate(Guid userId, Guid recipeId, RecipeRate rate);

        public void RemoveRecipe(Guid id);

        public ImmutableList<Recipe> ListAllRecipes();

        public ImmutableDictionary<Guid, RecipeRate> ListRatesOf(Guid user);

        public ImmutableDictionary<Guid, uint> GetRecipeListOf(Guid user);
    }
}
