namespace ZB.MOM.WW.ScadaBridge.AuditLog.Site;

/// <summary>
/// Options for the site-side SQLite hot-path audit writer.
/// Mirrors the ZB.MOM.WW.ScadaBridge.SiteEventLogging pattern: a single SQLite connection
/// fed by a background writer task draining a bounded
/// <see cref="System.Threading.Channels.Channel{T}"/> so script-thread enqueues
/// never block on disk I/O.
/// </summary>
public sealed class SqliteAuditWriterOptions
{
    /// <summary>SQLite database path (or in-memory URI for tests).</summary>
    public string DatabasePath { get; set; } = "auditlog.db";

    /// <summary>
    /// Capacity of the bounded write queue. Set high enough that ordinary
    /// script bursts never fill it; <see cref="System.Threading.Channels.BoundedChannelFullMode.Wait"/>
    /// applies when the writer falls behind.
    /// </summary>
    public int ChannelCapacity { get; set; } = 4096;

    /// <summary>Max number of pending events the writer drains in one transaction.</summary>
    public int BatchSize { get; set; } = 256;

    /// <summary>Soft flush interval the writer enforces when fewer than BatchSize events are queued.</summary>
    public int FlushIntervalMs { get; set; } = 50;
}
