using adas_core.Domain.Models.Pumps;

namespace adas_core.Application.Repositories.Interfaces;

public interface IPumpStateRepository
{
    /// <summary>
    /// Asynchronously retrieves the pump state associated with the specified device identifier.
    /// Returns null when no matching pump state is found for the given device identifier.
    /// </summary>
    /// <param name="deviceId">The unique identifier of the device whose pump state is being looked up.</param>
    /// <returns>A task that resolves to the PumpState if a match is found, or null if no pump state exists for the specified device.</returns>
    Task<PumpState?> FindByDeviceIdAsync(string deviceId);

    /// <summary>
    /// Asynchronously creates or updates a pump state record in the data store.
    /// </summary>
    /// <param name="state">The pump state to be inserted if it does not exist, or updated if it already exists.</param>
    Task UpsertAsync(PumpState state);

    /// <summary>
    /// Asynchronously retrieves all available pump states.
    /// </summary>
    /// <returns>A task that represents the asynchronous operation. The task result contains a collection of all <see cref="PumpState"/> objects.</returns>
    Task<IEnumerable<PumpState>> GetAllAsync();
}