feat(commons): add audit telemetry + pull message DTOs (#23)

This commit is contained in:
Joseph Doherty
2026-05-20 09:57:39 -04:00
parent 8ac5ebe97e
commit 08743bc42d
4 changed files with 141 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
using ScadaLink.Commons.Entities.Audit;
namespace ScadaLink.Commons.Messages.Integration;
/// <summary>
/// Audit Log (#23) telemetry envelope sent from a site to central over gRPC.
/// At-least-once delivery; central is idempotent on <see cref="AuditEvent.EventId"/>.
/// See Component-AuditLog.md "Ingestion" for the handoff contract.
/// </summary>
public sealed record AuditTelemetryEnvelope(
Guid EnvelopeId,
string SourceSiteId,
IReadOnlyList<AuditEvent> Events);

View File

@@ -0,0 +1,11 @@
namespace ScadaLink.Commons.Messages.Integration;
/// <summary>
/// Audit Log (#23) periodic reconciliation pull request: central asks a site for
/// audit events since the given UTC watermark, up to <paramref name="BatchSize"/>.
/// Acts as the fallback when streaming telemetry is lost. See Component-AuditLog.md "Ingestion".
/// </summary>
public sealed record PullAuditEventsRequest(
string SourceSiteId,
DateTime SinceUtc,
int BatchSize);

View File

@@ -0,0 +1,12 @@
using ScadaLink.Commons.Entities.Audit;
namespace ScadaLink.Commons.Messages.Integration;
/// <summary>
/// Audit Log (#23) periodic reconciliation pull response: the next batch of site
/// audit events plus a <paramref name="MoreAvailable"/> flag signalling the caller
/// to advance the watermark and pull again. See Component-AuditLog.md "Ingestion".
/// </summary>
public sealed record PullAuditEventsResponse(
IReadOnlyList<AuditEvent> Events,
bool MoreAvailable);