namespace ZB.MOM.WW.OtOpcUa.Configuration.Entities; /// /// Per Phase 7 plan decision #8 — user-authored C# script source, referenced by /// and . One row per script, /// per generation. SourceHash is the compile-cache key. /// /// /// /// Scripts are generation-scoped: a draft's edit creates a new row in the draft /// generation, the old row stays frozen in the published generation. Shape mirrors /// the other generation-scoped entities (Equipment, Tag, etc.) — ScriptId is /// the stable logical id that carries across generations; ScriptRowId is the /// row identity. /// /// public sealed class Script { public Guid ScriptRowId { get; set; } public long GenerationId { get; set; } /// Stable logical id. Carries across generations. public required string ScriptId { get; set; } /// Operator-friendly name for log filtering + Admin UI list view. public required string Name { get; set; } /// Raw C# source. Size bounded by the DB column (nvarchar(max)). public required string SourceCode { get; set; } /// SHA-256 of — compile-cache key for Phase 7 Stream A's CompiledScriptCache. public required string SourceHash { get; set; } /// Language — always "CSharp" today; placeholder for future engines (Python/Lua). public string Language { get; set; } = "CSharp"; public ConfigGeneration? Generation { get; set; } }