fix(mgmt): MV-10 review fixes (ElementDataType fixed-field in LockEnforcer; graceful bad-DataType error; message consistency)

This commit is contained in:
Joseph Doherty
2026-06-16 16:13:38 -04:00
parent 1525670fe7
commit 0164f8a0d6
5 changed files with 144 additions and 4 deletions
@@ -15,7 +15,7 @@ namespace ZB.MOM.WW.ScadaBridge.TemplateEngine;
/// overrides that were previously blocked (TemplateEngine-022).
///
/// Override granularity:
/// - Attributes: Value and Description overridable; DataType and DataSourceReference fixed.
/// - Attributes: Value and Description overridable; DataType, ElementDataType and DataSourceReference fixed.
/// - Alarms: Priority, TriggerConfiguration, Description, OnTriggerScript overridable; Name and TriggerType fixed.
/// - Scripts: Code, TriggerConfiguration, MinTimeBetweenRuns, ExecutionTimeoutSeconds, params/return overridable; Name fixed.
/// - Lock flag applies to the entire member (attribute/alarm/script).
@@ -43,6 +43,12 @@ public static class LockEnforcer
return $"Attribute '{original.Name}': DataType cannot be overridden (fixed).";
}
// ElementDataType is fixed (the element scalar type of a List attribute) — cannot change
if (proposed.ElementDataType != original.ElementDataType)
{
return $"Attribute '{original.Name}': ElementDataType cannot be overridden (fixed).";
}
// DataSourceReference is fixed — cannot change
if (proposed.DataSourceReference != original.DataSourceReference)
{
@@ -982,6 +982,7 @@ public class TemplateService
{
Value = attr.Value,
DataType = attr.DataType,
ElementDataType = attr.ElementDataType,
IsLocked = attr.IsLocked,
Description = attr.Description,
DataSourceReference = attr.DataSourceReference,