using Seenginx.Models;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Seenginx.Services
{
	public interface INginxService
	{
		Task<IEnumerable<ConfigFile>> GetFilesAsync();
		Task<IEnumerable<Template>> GetTemplates();

		Task<Result<string>> TestFileAsync(ConfigFile configFile);

		Task<Result> ValidateForAddFileAsync(NewFileForm newFileForm);
		Task<Result<ConfigFile>> AddFileAsync(NewFileForm newFileForm);

		Task<Result> ValidateForSaveFileAsync(ConfigFile configFile);
		Task<Result<ConfigFile>> SaveFileAsync(ConfigFile configFile);

		Task<Result> ValidateForSaveDraftFileAsync(ConfigFile configFile);
		Task<Result<ConfigFile>> SaveDraftFileAsync(ConfigFile configFile);

		Task<Result> ValidateForRenameFileAsync(List<ConfigFile> configFiles, ConfigFile configFile, string newName);
		Task<Result<ConfigFile>> RenameFileAsync(ConfigFile configFile, string newName);

		Task<Result> ValidateForDeleteFileAsync(ConfigFile configFile);
		Task<Result> DeleteFileAsync(ConfigFile configFile);
	}
}