using ScadaLink.Communication.Grpc; namespace ScadaLink.AuditLog.Site.Telemetry; /// /// Mockable abstraction over the central site-stream gRPC client surface that /// uses to push /// payloads. The production implementation (added in Bundle E host wiring) /// wraps the auto-generated SiteStreamService.SiteStreamServiceClient; /// unit tests substitute via NSubstitute against this interface so the actor /// never needs a live gRPC channel. /// public interface ISiteStreamAuditClient { /// /// Pushes to the central IngestAuditEvents /// RPC. The returned carries the /// accepted_event_ids the actor will flip to /// /// in the site SQLite queue. /// Task IngestAuditEventsAsync(AuditEventBatch batch, CancellationToken ct); /// /// Pushes the combined (Audit Log #23 / M3) /// to the central IngestCachedTelemetry RPC. 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 M3 site-side forwarder can flip the underlying audit rows to /// /// once central has acknowledged them. /// /// /// The production gRPC-backed implementation lands in M6 (no site→central /// gRPC channel exists today); until then the default /// binding returns an empty ack and /// integration tests substitute a direct-actor client that routes the batch /// straight into the in-process AuditLogIngestActor. /// Task IngestCachedTelemetryAsync(CachedTelemetryBatch batch, CancellationToken ct); }