using adas_core.Domain.Models.MongoModels;

namespace adas_core.Application.Repositories.Interfaces;

public interface IConfigPumpsRepository : IMongoRepository<ConfigPumps>
{
    /// <summary>
    /// Asynchronously retrieves a ConfigPumps configuration by its unique identifier.
    /// Returns null when no matching configuration is found.
    /// </summary>
    /// <param name="id">The unique identifier of the configuration to look up.</param>
    /// <returns>A task that yields the matching ConfigPumps instance, or null if no configuration is found for the specified id.</returns>
    Task<ConfigPumps?> FindById(string id);
    /// <summary>
    /// Retrieves all pump configurations asynchronously.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation, containing a list of <see cref="ConfigPumps"/> if found, or <c>null</c> if no configurations are available.</returns>
    Task<List<ConfigPumps>?> GetAllConfigs();

    /// <summary>
    /// Updates the pumps configuration using the supplied <paramref name="config"/> instance.
    /// </summary>
    /// <param name="config">The pumps configuration to be persisted.</param>
    /// <returns>A task that resolves to the updated <see cref="ConfigPumps"/> instance, or <see langword="null"/> if the configuration could not be found.</returns>
    Task<ConfigPumps?> UpdateConfig(ConfigPumps config);
    /// <summary>
    /// Asynchronously deletes the specified pump configuration.
    /// </summary>
    /// <param name="config">The pump configuration to delete.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains <c>true</c> if the configuration was successfully deleted; otherwise, <c>false</c>.</returns>
    Task<bool> DeleteConfig(ConfigPumps config);
}