using Lactose.Models;

namespace Lactose.Repositories;

/// <summary>
/// Interface for managing settings in the repository.
/// </summary>
public interface ISettingsRepository {
    /// <summary>
    /// Creates a settings entry in the repository. If a settings entry already exists, it will be overwritten.
    /// </summary>
    /// <param name="setting">The settings to create.</param>
    public void Create(Setting setting);

    /// <summary>
    /// Retrieves the settings from the repository.
    /// </summary>
    /// <returns>The settings if found; otherwise, null.</returns>
    public IEnumerable<Setting> Get();

    /// <summary>
    /// Try to get a specific setting by its name.
    /// </summary>
    /// <returns> The setting if found; otherwise, null.</returns>
    public Setting? Get(string name);

    /// <summary>
    /// Updates the settings in the repository.
    /// </summary>
    /// <param name="setting">The settings to update.</param>
    public void Update(Setting setting);

    /// <summary>
    /// Deletes the settings from the repository.
    /// </summary>
    public void Delete();

    /// <summary>
    /// Delete a specific setting by its name.
    /// </summary>
    /// <param name="name">name key of the setting to remove</param>
    public void Delete(string name);
    
    /// <summary>
    /// Deletes a specific setting from the repository.
    /// </summary>
    /// <param name="setting">Setting instance to delete</param>
    public void Delete(Setting setting);
    
}