namespace ScadaLink.NotificationService;

/// <summary>
/// Abstraction over SMTP client for testability.
/// </summary>
public interface ISmtpClientWrapper
{
    /// <summary>
    /// Connects to the SMTP server.
    /// </summary>
    /// <param name="tlsMode">
    /// NS-005: explicit three-state TLS mode (None/StartTls/Ssl) — replaces the old
    /// <c>bool useTls</c> which could not represent implicit-SSL and silently fell
    /// back to opportunistic negotiation for non-StartTLS configurations.
    /// </param>
    /// <param name="connectionTimeoutSeconds">
    /// NS-007: SMTP connection/operation timeout in seconds. A non-positive value
    /// leaves the client's default timeout in place.
    /// </param>
    Task ConnectAsync(
        string host,
        int port,
        SmtpTlsMode tlsMode,
        int connectionTimeoutSeconds,
        CancellationToken cancellationToken = default);
    Task AuthenticateAsync(string authType, string? credentials, CancellationToken cancellationToken = default);
    Task SendAsync(string from, IEnumerable<string> bccRecipients, string subject, string body, CancellationToken cancellationToken = default);
    Task DisconnectAsync(CancellationToken cancellationToken = default);
}
