Implement phase 4 critical table imports
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user