namespace RolemasterDb.ImportTool;

public sealed class ImportArtifactPaths
{
    private ImportArtifactPaths(
        string directoryPath,
        string xmlPath,
        string fragmentsJsonPath,
        string parsedCellsJsonPath,
        string validationReportPath)
    {
        DirectoryPath = directoryPath;
        XmlPath = xmlPath;
        FragmentsJsonPath = fragmentsJsonPath;
        ParsedCellsJsonPath = parsedCellsJsonPath;
        ValidationReportPath = validationReportPath;
    }

    public string DirectoryPath { get; }
    public string XmlPath { get; }
    public string FragmentsJsonPath { get; }
    public string ParsedCellsJsonPath { get; }
    public string ValidationReportPath { get; }

    public static ImportArtifactPaths Create(string artifactsRootPath, string tableSlug)
    {
        var directoryPath = Path.Combine(artifactsRootPath, tableSlug);
        return new ImportArtifactPaths(
            directoryPath,
            Path.Combine(directoryPath, "source.xml"),
            Path.Combine(directoryPath, "fragments.json"),
            Path.Combine(directoryPath, "parsed-cells.json"),
            Path.Combine(directoryPath, "validation-report.json"));
    }
}
