feat(inbound-api): ApiMethod.TraceAllCalls (entity, migration, mgmt command, CLI --trace-all-calls)

Flow Debugger (design 2026-09-05 §5.2): bit NOT NULL DEFAULT 0 column + EF migration
20260906034113 with its docs/plans/sql production twin. CreateApiMethodCommand gains
TraceAllCalls=false; UpdateApiMethodCommand gains bool? TraceAllCalls (null = unchanged so an
older CLI never resets it). Management result echoes the flag; CLI create/update expose
--trace-all-calls; README carries the ~7-rows-per-call warning.

Claude-Session: https://claude.ai/code/session_01GSLkkHKz9JrAtmJjmQK3cP
This commit is contained in:
Joseph Doherty
2026-09-05 23:42:52 -04:00
parent febb268d89
commit 23157d2bcf
11 changed files with 2327 additions and 7 deletions
@@ -15,6 +15,12 @@ public class ApiMethod
/// <summary>Gets or sets the script execution timeout in seconds.</summary>
public int TimeoutSeconds { get; set; }
/// <summary>
/// When true every production call to this method is fully traced (Flow Debugger design
/// 2026-09-05 §5.2); intended for low-volume integration methods — ~7 audit rows per call.
/// </summary>
public bool TraceAllCalls { get; set; }
/// <summary>Initializes a new <see cref="ApiMethod"/> with the required name and script.</summary>
/// <param name="name">The method name (used as the route segment).</param>
/// <param name="script">The C# script body to execute.</param>
@@ -2,6 +2,8 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.Management;
public record ListApiMethodsCommand;
public record GetApiMethodCommand(int ApiMethodId);
public record CreateApiMethodCommand(string Name, string Script, int TimeoutSeconds, string? ParameterDefinitions, string? ReturnDefinition);
public record UpdateApiMethodCommand(int ApiMethodId, string Script, int TimeoutSeconds, string? ParameterDefinitions, string? ReturnDefinition);
/// <param name="TraceAllCalls">Flow Debugger (design 2026-09-05 §5.2): trace every production call to this method. Additive; defaults to off.</param>
public record CreateApiMethodCommand(string Name, string Script, int TimeoutSeconds, string? ParameterDefinitions, string? ReturnDefinition, bool TraceAllCalls = false);
/// <param name="TraceAllCalls">Flow Debugger (design 2026-09-05 §5.2): <c>null</c> leaves the stored value unchanged so an older CLI never resets it.</param>
public record UpdateApiMethodCommand(int ApiMethodId, string Script, int TimeoutSeconds, string? ParameterDefinitions, string? ReturnDefinition, bool? TraceAllCalls = null);
public record DeleteApiMethodCommand(int ApiMethodId);