Implement phase 4 critical table imports

This commit is contained in:
2026-03-14 03:27:14 +01:00
parent a391a1421a
commit b2f61c3d73
17 changed files with 1280 additions and 474 deletions

View File

@@ -43,6 +43,15 @@ public sealed class CriticalImportLoader(string databasePath)
Notes = table.Notes
};
entity.Groups = table.Groups
.Select(item => new CriticalGroup
{
GroupKey = item.GroupKey,
Label = item.Label,
SortOrder = item.SortOrder
})
.ToList();
entity.Columns = table.Columns
.Select(item => new CriticalColumn
{
@@ -63,12 +72,14 @@ public sealed class CriticalImportLoader(string databasePath)
})
.ToList();
var groupsByKey = entity.Groups.ToDictionary(item => item.GroupKey, StringComparer.OrdinalIgnoreCase);
var columnsByKey = entity.Columns.ToDictionary(item => item.ColumnKey, StringComparer.OrdinalIgnoreCase);
var rollBandsByLabel = entity.RollBands.ToDictionary(item => item.Label, StringComparer.OrdinalIgnoreCase);
entity.Results = table.Results
.Select(item => new CriticalResult
{
CriticalGroup = item.GroupKey is null ? null : groupsByKey[item.GroupKey],
CriticalColumn = columnsByKey[item.ColumnKey],
CriticalRollBand = rollBandsByLabel[item.RollBandLabel],
RawCellText = item.RawCellText,