feat(transport): round-trip ElementDataType for List attributes

Add DataType? ElementDataType to TemplateAttributeDto (optional, default null
for backward-compat with old bundles). Map it in both directions in
EntitySerializer (export + FromBundleContent) and in all three
TemplateAttribute construction sites in BundleImporter (BuildTemplate,
SyncTemplateAttributesAsync add-path, and SyncTemplateAttributesAsync
update-path including change-detection). Two new round-trip tests in
EntitySerializerTests confirm List attributes survive export→import and that
old DTOs with null ElementDataType import cleanly.
This commit is contained in:
Joseph Doherty
2026-06-16 15:23:39 -04:00
parent 4a4b3d677d
commit e7e34b26f1
4 changed files with 77 additions and 3 deletions
@@ -51,7 +51,8 @@ public sealed class EntitySerializer
DataType: a.DataType,
IsLocked: a.IsLocked,
Description: a.Description,
DataSourceReference: a.DataSourceReference)).ToList(),
DataSourceReference: a.DataSourceReference,
ElementDataType: a.ElementDataType)).ToList(),
Alarms: t.Alarms.Select(a => new TemplateAlarmDto(
Name: a.Name,
Description: a.Description,
@@ -203,6 +204,7 @@ public sealed class EntitySerializer
IsLocked = a.IsLocked,
Description = a.Description,
DataSourceReference = a.DataSourceReference,
ElementDataType = a.ElementDataType,
});
}
foreach (var al in dto.Alarms)