feat(template): stamp ElementDataType on instance attribute overrides

Set existingOverride.ElementDataType and newOverride.ElementDataType from
templateAttr.ElementDataType in both the update and create branches of
SetAttributeOverrideAsync, so the persisted InstanceAttributeOverride row
always carries the element type for later central normalizer use (#93/M3).
This commit is contained in:
Joseph Doherty
2026-06-16 17:33:15 -04:00
parent 180d55482b
commit abe8832e9e
2 changed files with 103 additions and 1 deletions
@@ -172,6 +172,7 @@ public class InstanceService
if (existingOverride != null)
{
existingOverride.OverrideValue = overrideValue;
existingOverride.ElementDataType = templateAttr.ElementDataType;
await _repository.UpdateInstanceAttributeOverrideAsync(existingOverride, cancellationToken);
await _repository.SaveChangesAsync(cancellationToken);
@@ -185,7 +186,8 @@ public class InstanceService
var newOverride = new InstanceAttributeOverride(attributeName)
{
InstanceId = instanceId,
OverrideValue = overrideValue
OverrideValue = overrideValue,
ElementDataType = templateAttr.ElementDataType
};
await _repository.AddInstanceAttributeOverrideAsync(newOverride, cancellationToken);