using ScadaLink.Communication.Grpc;
namespace ScadaLink.AuditLog.Site.Telemetry;
///
/// Default registered by
/// .
/// Ships with M2 site-sync-pipeline wiring; the real gRPC-backed
/// implementation is deferred to M6 reconciliation, where a site→central gRPC
/// channel will be introduced (no such channel exists today — sites talk to
/// central exclusively via Akka ClusterClient, while the gRPC SiteStreamService
/// is hosted on the SITE side for central→site streaming).
///
///
///
/// Returns an empty so the
/// doesn't flip any rows to
/// Forwarded when this NoOp is in effect — Bundle H's integration test
/// substitutes a stub client that routes directly to the central
/// AuditLogIngestActor in-process. Production wiring (M6) will replace
/// this binding with a real client.
///
///
/// Audit-write paths are best-effort by contract: a NoOp client keeps the
/// host running cleanly and is consistent with "audit-write failures never
/// abort the user-facing action".
///
///
public sealed class NoOpSiteStreamAuditClient : ISiteStreamAuditClient
{
private static readonly IngestAck EmptyAck = new();
///
public Task IngestAuditEventsAsync(AuditEventBatch batch, CancellationToken ct)
{
ArgumentNullException.ThrowIfNull(batch);
// Empty ack — no EventIds will be flipped to Forwarded, so rows stay
// Pending until M6's real client (or a Bundle H test stub) takes over.
return Task.FromResult(EmptyAck);
}
}