namespace LiquidCode.Tester.Worker.Services;

public interface ICompilationService
{
    /// <summary>
    /// Compiles source code to an executable
    /// </summary>
    /// <param name="sourceCode">Source code to compile</param>
    /// <param name="workingDirectory">Directory to compile in</param>
    /// <param name="version">Language version (e.g., "17", "20", "latest"). If null or "latest", uses default version.</param>
    /// <returns>Result containing success status, executable path, and error messages</returns>
    Task<CompilationResult> CompileAsync(string sourceCode, string workingDirectory, string? version = null);
}

public class CompilationResult
{
    public bool Success { get; set; }
    public string? ExecutablePath { get; set; }
    public string ErrorMessage { get; set; } = string.Empty;
    public string CompilerOutput { get; set; } = string.Empty;
}
