namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery;

/// <summary>
/// Request to query site event logs from central.
/// Supports filtering by event type, severity, instance, time range, and keyword search.
/// Uses keyset pagination via an opaque continuation token.
/// </summary>
/// <param name="InstanceId">
/// Instance filter matched against the site event log's <c>instance_id</c> column,
/// which stores the instance <b>UniqueName</b> (InstanceActor.LogLifecycleEvent passes
/// <c>_instanceUniqueName</c>; EventLogQueryService matches <c>instance_id = $instanceId</c>).
/// </param>
/// <param name="ContinuationToken">
/// Opaque cursor from the previous response's <c>ContinuationToken</c>, or
/// <see langword="null"/> to start from the oldest matching event. Treat as opaque —
/// it encodes timestamp and id together and its format is not part of the contract.
/// An unparseable token is treated as "start from the beginning" rather than an error.
/// </param>
public record EventLogQueryRequest(
    string CorrelationId,
    string SiteId,
    DateTimeOffset? From,
    DateTimeOffset? To,
    string? EventType,
    string? Severity,
    string? InstanceId,
    string? KeywordFilter,
    string? ContinuationToken,
    int PageSize,
    DateTimeOffset Timestamp);
