using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace GB5Shared.Archive
{
///
/// Optional interface for indexing audit events into Elasticsearch.
/// Implement when the platform needs full-text search across event data.
/// Not implemented in this release — register a no-op if needed.
///
/// Typical integration point: called from EventLogSubBLL after TEVENTLOG write.
///
public interface IElasticAuditIndexer
{
/// Index a single audit event (e.g. after real-time write).
Task IndexAsync(AuditIndexDocument document, CancellationToken ct = default);
/// Bulk-index a batch (e.g. after archive read-back for initial ingest).
Task BulkIndexAsync(IEnumerable documents, CancellationToken ct = default);
}
/// Minimal document shape for Elasticsearch indexing.
public sealed class AuditIndexDocument
{
public int EventLogId { get; set; }
public int EventTypeId { get; set; }
public int UserId { get; set; }
public int TenantId { get; set; }
public string? EventText { get; set; }
public string? Data { get; set; }
public string? Timestamp { get; set; } // ISO 8601
}
}