namespace GB5Shared.DTO.Ice; public class IceMapDTO { // ── IceMap ─────────────────────────────────────────────────────── public int IceMapId { get; set; } //Id public string? IceMapCode { get; set; } //Code public string? IceMapName { get; set; } //Name public byte IceMapIceSourceType { get; set; } //SourceType public string? IceMapSourceFileName { get; set; } //SourceFileName public string? IceMapMapToType { get; set; } //MapToType // ── Entity ─────────────────────────────────────────────────────── public int IceMapEntityId { get; set; } //Id public string? IceMapEntityCode { get; set; } //Code public string? IceMapEntityName { get; set; } //Name // MENTITY.POCOTODTOLINKID for IceMapEntityId (see IceMapQB.GET_ICEMAP). IceMapDetails rows' // DestinationMemberEntityId is always the DTO-side entity (joined via MENTITYMEMBERS), while // IceMapEntityId itself is the POCO-side MICEMAP.ENTITYID — a different MENTITY row whenever the // entity has a distinct POCO/DTO split. Legacy GB4 (IceImportLatestTunedAsynchornous. // AssignValueParentAndSave) always walks this link before comparing/using the entity id; GB5 must // do the same — use IceMapRootEntityId below, never IceMapEntityId, when matching against // DestinationMemberEntityId. public int IceMapEntityPocoToDtoLinkId { get; set; } // The entity id to compare against IceMapDetailsDTO.DestinationMemberEntityId. Falls back to // IceMapEntityId only if the join somehow didn't resolve (defensive — MENTITY.POCOTODTOLINKID is // always populated, even as a self-reference when no distinct DTO split exists). // NOTE: entity ids in this system are frequently large NEGATIVE seed values (e.g. -2147481747), // so "unresolved" must be tested as != 0, never > 0 — a positivity check silently discards every // valid negative id and falls back to the wrong (POCO-side) entity. public int IceMapRootEntityId => IceMapEntityPocoToDtoLinkId != 0 ? IceMapEntityPocoToDtoLinkId : IceMapEntityId; public int IceMapKeyField { get; set; } //KeyField public string? IceMapSourceSheetName { get; set; } //SourceSheetName public string? IceMapRemarks { get; set; } //Remarks // ── Base ───────────────────────────────────────────────────────── public int IceMapCreatedById { get; set; } //CreatedById public DateTime IceMapCreatedOn { get; set; } //CreatedOn public int IceMapModifiedById { get; set; } //ModifiedById public DateTime IceMapModifiedOn { get; set; } //ModifiedOn // ── Standard ───────────────────────────────────────────────────── public short IceMapSortOrder { get; set; } //SortOrder public byte IceMapStatus { get; set; } //Status public short IceMapVersion { get; set; } //Version public byte IceMapSourceType { get; set; } //SourceType public List IceMapDetailsArray { get; set; } = new List(); public byte IceMapNoOfHeaderRows { get; set; } = 1; public byte IceMapNoOfHeaderColumn { get; set; } = 0; public byte IceMapMapType { get; set; } = 2; public int TemplateFileId { get; set; } = -1; public string? TemplateFileName { get; set; } public string? TemplateFileLocation { get; set; } }