namespace IceImportDAL.DTO.IceImportPipeline; // One mapped/resolved row for a single destination entity, produced by MapAndTransformAsync. // Fields is what gets POSTed (as JSON) to the target entity's Save/Update WebService. // Children is keyed by DestinationMemberEntityId — HierarchyMapper groups IceMapDetails rows // belonging to a child entity under the parent row that owns them. public class MappedEntityRowDTO { public int RowNumber { get; set; } // In-memory correlation id assigned before any DB save happens (HierarchyMapper), so // ParentIdAssignmentResolver/FirstParentValueResolver have something stable to reference // even though the real DB-assigned parent id isn't known until after the parent's own save. public Guid CorrelationKey { get; set; } = Guid.NewGuid(); public int EntityId { get; set; } public string EntityCode { get; set; } = string.Empty; public Dictionary Fields { get; set; } = new(StringComparer.OrdinalIgnoreCase); public Dictionary> Children { get; set; } = new(); // Populated by HierarchyMapper/CommitAsync once the real parent id is known — read by // AddonFieldAccumulator/persistence code, not by the field resolvers themselves. public int? ResolvedTargetId { get; set; } // Warning-severity findings produced by field resolvers during MapAndTransformAsync (e.g. // SourceValueResolver's type-coercion failures) — never silently dropped. Not part of the // plan's original DTO sketch (RowNumber/CorrelationKey/Fields/Children); added because a // resolver-level "never silently default" requirement needs SOME carrier, and // IIceImportPipeline.ValidateAsync merges these into its returned // IceImportRowValidationResultDTO.Errors alongside IRowValidator findings. public List FieldWarnings { get; set; } = new(); }