namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging;
public class SiteEventLogOptions
{
/// Number of days to retain site event log entries before purge; default 30.
public int RetentionDays { get; set; } = 30;
/// Maximum SQLite database size in megabytes before old entries are purged; default 1024 MB.
public int MaxStorageMb { get; set; } = 1024;
/// File path for the site event log SQLite database.
public string DatabasePath { get; set; } = "site_events.db";
/// Maximum number of rows returned per paginated query; default 500.
public int QueryPageSize { get; set; } = 500;
///
/// SiteEventLogging-017: hard upper bound on a caller-supplied PageSize. A
/// misbehaving or hostile central client that requests int.MaxValue would
/// otherwise force the query to materialise the entire log into a single list while
/// holding the shared write lock. Silent clamp; default 500 matches
/// .
///
public int MaxQueryPageSize { get; set; } = 500;
/// Interval between purge runs; default 24 hours.
public TimeSpan PurgeInterval { get; set; } = TimeSpan.FromHours(24);
///
/// SiteEventLogging-015: bound on the background write queue. Default 10 000 events.
/// Overflow uses BoundedChannelFullMode.DropOldest — callers never block; the
/// dropped event's Task is faulted and FailedWriteCount is incremented
/// so the drop is observable.
///
public int WriteQueueCapacity { get; set; } = 10_000;
}