using adas_core.Domain.Models;
using adas_core.Domain.Models.MongoModels;
using adas_core.Domain.Models.Pumps;

namespace adas_core.Application.Services.Interfaces;

public interface IConfigPumpsService
{
    /// <summary>
    /// Asynchronously maps the source PumpObservation to a new PumpObservation instance, transforming its data into the target representation.
    /// </summary>
    /// <param name="obs">The source PumpObservation to be mapped.</param>
    /// <returns>A task that represents the asynchronous mapping operation, containing the resulting PumpObservation.</returns>
    Task<PumpObservation> Map(PumpObservation obs);
    /// <summary>
    /// Retrieves all available pump configurations from the configuration store.
    /// </summary>
    /// <returns>A task containing a list of <see cref="ConfigPumps"/> with all pump configurations, or <c>null</c> if no configurations are available.</returns>
    Task<List<ConfigPumps>?> GetAllPumpConfigs();
    /// <summary>
    /// Asynchronously retrieves the configuration pump items associated with the specified identifier.
    /// Returns null if no configuration items are found for the given id.
    /// </summary>
    /// <param name="id">The unique identifier used to look up the configuration items.</param>
    /// <returns>A task containing a list of ConfigPumpItem objects if found, or null if no items exist for the specified id.</returns>
    Task<List<ConfigPumpItem>?> GetConfigItems(string id);
    /// <summary>
    /// Asynchronously retrieves the pump configuration that matches the specified identifier.
    /// </summary>
    /// <param name="id">The unique identifier of the pump configuration to look up.</param>
    /// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="ConfigPumps"/> configuration if found; otherwise, <c>null</c> when no configuration exists for the given identifier.</returns>
    Task<ConfigPumps?> GetPumpConfigById(string id);
    /// <summary>
    /// Updates the pump configuration asynchronously and returns the updated configuration.
    /// </summary>
    /// <param name="pumpConfig">The pump configuration to update.</param>
    /// <returns>A task that represents the asynchronous operation, containing the updated <see cref="ConfigPumps"/>, or <c>null</c> if the configuration was not found.</returns>
    Task<ConfigPumps?> UpdatePumpConfig(ConfigPumps pumpConfig);
    /// <summary>
    /// Inserts a new pump configuration into the data store.
    /// </summary>
    /// <param name="pumpConfig">The pump configuration to insert.</param>
    /// <returns>The inserted <see cref="ConfigPumps"/> entity, or <c>null</c> if the insertion was not performed.</returns>
    Task<ConfigPumps?> InsertPumpConfig(ConfigPumps pumpConfig);
    /// <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 a boolean indicating whether the deletion was successful.</returns>
    Task<bool> DeletePumpConfig(ConfigPumps config);
    /// <summary>
    /// Asynchronously evaluates and applies retention actions for a pump observation, returning the resulting retention outcome.
    /// </summary>
    /// <param name="obs">The pump observation to process for retention actions.</param>
    /// <returns>A task that represents the asynchronous operation, containing the retention result, or null if no retention action applies.</returns>
    Task<ObservatitonRetentionResult?> RetentionActions(PumpObservation obs);
    
}