feat(sitecall-audit): add SourceNode to SiteCallOperational + SiteCall entity
This commit is contained in:
@@ -162,6 +162,9 @@ public sealed class CachedCallLifecycleBridge : ICachedCallLifecycleObserver
|
||||
Channel: context.Channel,
|
||||
Target: context.Target,
|
||||
SourceSite: context.SourceSite,
|
||||
// SourceNode: stamped by Task 14 once the bridge gets an
|
||||
// INodeIdentityProvider; null until then.
|
||||
SourceNode: null,
|
||||
Status: operationalStatus,
|
||||
RetryCount: context.RetryCount,
|
||||
LastError: lastError,
|
||||
|
||||
@@ -30,6 +30,15 @@ public sealed record SiteCall
|
||||
/// <summary>Site id that submitted the cached call.</summary>
|
||||
public required string SourceSite { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The cluster node on which the cached call was emitted — <c>node-a</c> /
|
||||
/// <c>node-b</c> for site rows (qualified by <see cref="SourceSite"/>),
|
||||
/// <c>central-a</c> / <c>central-b</c> for central-originated rows. Stamped
|
||||
/// by the emitting node from <c>INodeIdentityProvider</c>; nullable so
|
||||
/// reconciled rows from a node that has since been retired don't block ingest.
|
||||
/// </summary>
|
||||
public string? SourceNode { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Lifecycle status — string form of
|
||||
/// <see cref="ScadaLink.Commons.Types.Enums.AuditStatus"/>. Monotonic: later rank
|
||||
|
||||
@@ -21,6 +21,13 @@ namespace ScadaLink.Commons.Types;
|
||||
/// </param>
|
||||
/// <param name="Target">Human-readable target (e.g. <c>"ERP.GetOrder"</c>).</param>
|
||||
/// <param name="SourceSite">Site id that submitted the cached call.</param>
|
||||
/// <param name="SourceNode">
|
||||
/// The cluster node on which the cached call was emitted — <c>node-a</c> / <c>node-b</c>
|
||||
/// for site rows (qualified by <paramref name="SourceSite"/>), <c>central-a</c> /
|
||||
/// <c>central-b</c> for central-originated rows. Stamped by the emitting node from
|
||||
/// <c>INodeIdentityProvider</c>; nullable so reconciled rows from a node that has since
|
||||
/// been retired don't block ingest.
|
||||
/// </param>
|
||||
/// <param name="Status">
|
||||
/// Lifecycle status — string form of <see cref="ScadaLink.Commons.Types.Enums.AuditStatus"/>:
|
||||
/// <c>Submitted</c>, <c>Retrying</c>, <c>Attempted</c>, <c>Delivered</c>,
|
||||
@@ -37,6 +44,7 @@ public sealed record SiteCallOperational(
|
||||
string Channel,
|
||||
string Target,
|
||||
string SourceSite,
|
||||
string? SourceNode,
|
||||
string Status,
|
||||
int RetryCount,
|
||||
string? LastError,
|
||||
|
||||
@@ -648,6 +648,9 @@ public class ScriptRuntimeContext
|
||||
Channel: "ApiOutbound",
|
||||
Target: target,
|
||||
SourceSite: _siteId,
|
||||
// SourceNode: stamped by Task 14 once the script context
|
||||
// gets an INodeIdentityProvider; null until then.
|
||||
SourceNode: null,
|
||||
Status: "Submitted",
|
||||
RetryCount: 0,
|
||||
LastError: null,
|
||||
@@ -766,6 +769,9 @@ public class ScriptRuntimeContext
|
||||
Channel: "ApiOutbound",
|
||||
Target: target,
|
||||
SourceSite: _siteId,
|
||||
// SourceNode: stamped by Task 14 once the script context
|
||||
// gets an INodeIdentityProvider; null until then.
|
||||
SourceNode: null,
|
||||
Status: "Attempted",
|
||||
// RetryCount stays 0 — the operation never reached the
|
||||
// S&F retry sweep, so no retries were performed.
|
||||
@@ -833,6 +839,9 @@ public class ScriptRuntimeContext
|
||||
Channel: "ApiOutbound",
|
||||
Target: target,
|
||||
SourceSite: _siteId,
|
||||
// SourceNode: stamped by Task 14 once the script context
|
||||
// gets an INodeIdentityProvider; null until then.
|
||||
SourceNode: null,
|
||||
Status: operationalTerminalStatus,
|
||||
RetryCount: 0,
|
||||
LastError: result.Success ? null : result.ErrorMessage,
|
||||
@@ -1243,6 +1252,9 @@ public class ScriptRuntimeContext
|
||||
Channel: "DbOutbound",
|
||||
Target: target,
|
||||
SourceSite: _siteId,
|
||||
// SourceNode: stamped by Task 14 once the script context
|
||||
// gets an INodeIdentityProvider; null until then.
|
||||
SourceNode: null,
|
||||
Status: "Submitted",
|
||||
RetryCount: 0,
|
||||
LastError: null,
|
||||
|
||||
Reference in New Issue
Block a user