namespace ZB.MOM.WW.GalaxyRepository;

/// <summary>
///     Abstraction over <see cref="GalaxyRepository"/>: the read-only SQL surface over the
///     AVEVA System Platform Galaxy Repository database. Exists so consumers (and the cache
///     layer, a later task) can be unit-tested against an in-memory fake without standing up a
///     real <c>Microsoft.Data.SqlClient</c> <c>SqlConnection</c> against a bogus host/port.
/// </summary>
public interface IGalaxyRepository
{
    /// <summary>Tests the connection to the Galaxy Repository database.</summary>
    /// <param name="ct">Token to cancel the asynchronous operation.</param>
    Task<bool> TestConnectionAsync(CancellationToken ct = default);

    /// <summary>Retrieves the last deployment time from the Galaxy Repository.</summary>
    /// <param name="ct">Token to cancel the asynchronous operation.</param>
    Task<DateTime?> GetLastDeployTimeAsync(CancellationToken ct = default);

    /// <summary>Retrieves the complete hierarchy of Galaxy objects from the repository.</summary>
    /// <param name="ct">Token to cancel the asynchronous operation.</param>
    Task<List<GalaxyHierarchyRow>> GetHierarchyAsync(CancellationToken ct = default);

    /// <summary>Retrieves all attributes for Galaxy objects from the repository.</summary>
    /// <param name="ct">Token to cancel the asynchronous operation.</param>
    Task<List<GalaxyAttributeRow>> GetAttributesAsync(CancellationToken ct = default);

    /// <summary>Returns the alarm-bearing attributes across deployed Galaxy objects.</summary>
    /// <param name="ct">Cancellation token.</param>
    /// <returns>The alarm-bearing attribute rows.</returns>
    Task<List<GalaxyAlarmAttributeRow>> GetAlarmAttributesAsync(CancellationToken ct = default);
}
