using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; namespace ZB.MOM.WW.ScadaBridge.AuditLog.Central; /// /// Mockable abstraction over the central-side PullSiteCalls gRPC client /// surface used by the Site Call Audit reconciliation tick to fetch the /// next batch of cached-call operational rows from a specific site — the /// documented periodic self-heal pull that backfills the eventually-consistent /// central SiteCalls mirror when best-effort push telemetry is lost. /// Extracted so the (separate, follow-up) reconciliation actor can be /// unit-tested against an in-memory stub without standing up a real /// GrpcChannel per site. /// /// /// /// The home is ZB.MOM.WW.ScadaBridge.AuditLog.Central rather than the /// ZB.MOM.WW.ScadaBridge.SiteCallAudit project so it can reuse the /// / endpoint-resolution /// abstraction that already lives here (and that the sibling /// uses) — SiteCallAudit does not reference /// AuditLog, so hosting the client there would mean duplicating the enumerator. /// This mirrors the decision to keep in /// ZB.MOM.WW.ScadaBridge.Communication. /// /// /// Implementations MUST NOT throw on transport faults the reconciliation tick /// can tolerate (connection refused, deadline exceeded, cancellation) — one /// offline site must never sink the rest of the tick. The /// are returned oldest-first by /// UpdatedAtUtc with the SourceSite re-stamped from the dialed /// site id (the site leaves it empty, being unaware of its own id), and a /// MoreAvailable flag the caller uses to decide whether to fire another /// pull immediately. /// /// public interface IPullSiteCallsClient { /// /// Issues a PullSiteCalls RPC against the site whose gRPC endpoint is /// registered against . Returns the next batch of /// rows /// ordered oldest-first (with SourceSite re-stamped from /// ) AND a MoreAvailable flag the caller uses /// to decide whether to fire another pull immediately. /// /// The identifier of the site to pull cached-call operational rows from. /// Only rows with an UpdatedAtUtc at or after this cursor time are returned. /// Maximum number of rows to return per call. /// Cancellation token. /// A task that resolves to the next reconciliation batch with a MoreAvailable flag. Task PullAsync( string siteId, DateTime sinceUtc, int batchSize, CancellationToken ct); }