using ZB.MOM.WW.ScadaBridge.Communication.Grpc; namespace ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; /// /// Mockable abstraction over the central site-audit push surface that /// uses to forward /// payloads. The production implementation is /// — wired in the Host for site /// roles, it forwards batches to central via the site's /// SiteCommunicationActor. Unit tests substitute via NSubstitute /// against this interface so the actor never needs a live transport. /// public interface ISiteStreamAuditClient { /// /// Forwards to the central audit-ingest path. The /// returned carries the accepted_event_ids /// the actor will flip to /// /// in the site SQLite queue. /// /// The batch of audit events to forward. /// Cancellation token for the operation. /// A task that resolves to the ingest acknowledgement containing accepted event IDs. Task IngestAuditEventsAsync(AuditEventBatch batch, CancellationToken ct); /// /// Forwards the combined /// to the central cached-telemetry ingest path. Each packet carries both the /// audit row and the operational SiteCalls upsert; central writes both /// in a single MS SQL transaction. Returns the same /// shape as so the site-side forwarder /// can flip the underlying audit rows to /// /// once central has acknowledged them. /// /// /// The production forwards over /// the site's central transport; the /// DI default (used by central and test composition roots) returns an empty /// ack so no rows are flipped. /// /// The batch of cached-call telemetry packets to forward. /// Cancellation token for the operation. /// A task that resolves to the ingest acknowledgement containing accepted event IDs. Task IngestCachedTelemetryAsync(CachedTelemetryBatch batch, CancellationToken ct); }