using ZB.MOM.WW.Audit;

namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services;

/// <summary>
/// Central-only audit writer for the direct-write path (Notification Outbox dispatch, Inbound API).
/// Distinct from <see cref="IAuditWriter"/> so DI binding can differ between site and central hosts.
/// </summary>
public interface ICentralAuditWriter
{
    /// <summary>
    /// Persist an audit event into the central AuditLog table directly (bypassing site telemetry).
    /// Best-effort: implementations must swallow/log internal failures rather than propagating them.
    /// </summary>
    /// <param name="evt">The audit event to persist.</param>
    /// <param name="ct">Cancellation token.</param>
    /// <returns>A task that represents the asynchronous operation.</returns>
    Task WriteAsync(AuditEvent evt, CancellationToken ct = default);
}
