using ScadaLink.Commons.Entities.Templates; namespace ScadaLink.TemplateEngine; /// /// Walks inheritance and composition chains to resolve effective template members. /// Produces canonical (path-qualified) names for composed module members. /// public static class TemplateResolver { /// /// Represents a resolved member from any point in the inheritance/composition hierarchy. /// public sealed record ResolvedTemplateMember { public string CanonicalName { get; init; } public string MemberType { get; init; } // "Attribute", "Alarm", "Script" public int SourceTemplateId { get; init; } public int MemberId { get; init; } public bool IsLocked { get; init; } public string? ModulePath { get; init; } public ResolvedTemplateMember(string canonicalName, string memberType, int sourceTemplateId, int memberId, bool isLocked, string? modulePath = null) { CanonicalName = canonicalName; MemberType = memberType; SourceTemplateId = sourceTemplateId; MemberId = memberId; IsLocked = isLocked; ModulePath = modulePath; } } /// /// Resolves all effective members for a template, walking inheritance and composition chains. /// Child members override parent members of the same canonical name (unless locked). /// public static IReadOnlyList ResolveAllMembers( int templateId, IReadOnlyList