fix(transport): export instance AreaName — Area-by-name reconciliation was half-shipped (exporter hardcoded null)
Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
@@ -248,10 +248,13 @@ public sealed class EntitySerializer
|
||||
UniqueName: inst.UniqueName,
|
||||
TemplateName: templateNameById.TryGetValue(inst.TemplateId, out var tn) ? tn : string.Empty,
|
||||
SiteIdentifier: siteIdentifierBySiteId.TryGetValue(inst.SiteId, out var isid) ? isid : string.Empty,
|
||||
// TODO: Areas don't travel in the bundle yet — EntityAggregate
|
||||
// carries no Areas collection, so there's no id→name lookup. Emit
|
||||
// null until area transport is added; the importer leaves AreaId null.
|
||||
AreaName: null,
|
||||
// Area travels by NAME — the importer resolves-or-creates the
|
||||
// equivalent area under the target site (ResolveOrCreateAreaIdAsync).
|
||||
// Resolve the instance's AreaId FK against the aggregate's id→name
|
||||
// map; if the FK is null (no area) or unresolved (orphan/absent from
|
||||
// the map), the name comes through as null and the importer leaves
|
||||
// AreaId null on the imported instance.
|
||||
AreaName: inst.AreaId is { } aid && aggregate.AreaNameById.TryGetValue(aid, out var an) ? an : null,
|
||||
State: inst.State,
|
||||
AttributeOverrides: inst.AttributeOverrides.Select(o => new InstanceAttributeOverrideDto(
|
||||
AttributeName: o.AttributeName,
|
||||
|
||||
Reference in New Issue
Block a user