Implement phase 4 critical table imports
This commit is contained in:
@@ -8,6 +8,8 @@ public sealed class CriticalImportCommandRunner
|
||||
private readonly ImportArtifactWriter artifactWriter = new();
|
||||
private readonly PdfXmlExtractor pdfXmlExtractor = new();
|
||||
private readonly StandardCriticalTableParser standardParser = new();
|
||||
private readonly VariantColumnCriticalTableParser variantColumnParser = new();
|
||||
private readonly GroupedVariantCriticalTableParser groupedVariantParser = new();
|
||||
|
||||
public async Task<int> RunAsync(ResetOptions options)
|
||||
{
|
||||
@@ -96,14 +98,24 @@ public sealed class CriticalImportCommandRunner
|
||||
?? throw new InvalidOperationException($"No enabled manifest entry was found for '{tableSlug}'.");
|
||||
}
|
||||
|
||||
private StandardCriticalTableParseResult Parse(CriticalImportManifestEntry entry, string xmlContent)
|
||||
private CriticalTableParseResult Parse(CriticalImportManifestEntry entry, string xmlContent)
|
||||
{
|
||||
if (!string.Equals(entry.Family, "standard", StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(entry.Family, "standard", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
throw new InvalidOperationException($"Family '{entry.Family}' is not supported by phase 2.");
|
||||
return standardParser.Parse(entry, xmlContent);
|
||||
}
|
||||
|
||||
return standardParser.Parse(entry, xmlContent);
|
||||
if (string.Equals(entry.Family, "variant_column", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return variantColumnParser.Parse(entry, xmlContent);
|
||||
}
|
||||
|
||||
if (string.Equals(entry.Family, "grouped_variant", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return groupedVariantParser.Parse(entry, xmlContent);
|
||||
}
|
||||
|
||||
throw new InvalidOperationException($"Family '{entry.Family}' is not supported by the importer.");
|
||||
}
|
||||
|
||||
private static ImportArtifactPaths CreateArtifactPaths(string slug) =>
|
||||
|
||||
Reference in New Issue
Block a user