using ScadaLink.Commons.Entities.Audit;

namespace ScadaLink.Commons.Interfaces.Services;

/// <summary>
/// Boundary-side abstraction for emitting Audit Log (#23) events.
/// Implementations on the site write to local SQLite hot-path; on central they write to MS SQL directly.
/// Failures must NEVER abort the user-facing action.
/// </summary>
public interface IAuditWriter
{
    /// <summary>
    /// Persist an audit event. Best-effort: implementations must swallow/log internal failures
    /// rather than propagating them to the calling boundary code.
    /// </summary>
    Task WriteAsync(AuditEvent evt, CancellationToken ct = default);
}
