feat(flow-debugger): FlowStep carries the audit CorrelationId; CLI table adds a correlation column

Claude-Session: https://claude.ai/code/session_01NcMG6xXdsJbmD2wYAgkK29
This commit is contained in:
Joseph Doherty
2026-09-06 10:58:50 -04:00
parent 4769e192e3
commit 7e3e809a70
7 changed files with 35 additions and 4 deletions
@@ -1,3 +1,4 @@
using ZB.MOM.WW.Audit;
using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit;
using ZB.MOM.WW.ScadaBridge.Commons.Types.Debugging;
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
@@ -161,4 +162,23 @@ public class FlowStepProjectorTests
occurredAtUtc: T0.UtcDateTime, target: "MesDb", extra: extra);
Assert.Equal(expected, FlowStepProjector.Project(evt).Subtitle);
}
[Fact]
public void Project_CarriesTheAuditRowsCorrelationId()
{
var corr = Guid.NewGuid();
var evt = ScadaBridgeAuditEventFactory.Create(AuditChannel.ApiOutbound, AuditKind.CachedSubmit, AuditStatus.Submitted,
occurredAtUtc: T0.UtcDateTime, target: "Delmia.Ack", executionId: Guid.NewGuid(), correlationId: corr, sourceSiteId: "site-a");
Assert.Equal(corr, FlowStepProjector.Project(evt).CorrelationId);
}
[Fact]
public void Project_NullCorrelation_LeavesCorrelationIdNull()
{
var evt = ScadaBridgeAuditEventFactory.Create(AuditChannel.ApiOutbound, AuditKind.ApiCall, AuditStatus.Delivered,
occurredAtUtc: T0.UtcDateTime, target: "Delmia.Ack", executionId: Guid.NewGuid(), sourceSiteId: "site-a");
Assert.Null(FlowStepProjector.Project(evt).CorrelationId);
}
}