namespace PlanTempus.Core.Configurations.SmartConfigProvider
{
    /// <summary>
    /// Configuration options for setting up smart configuration providers.
    /// Provides fluent configuration methods for specifying the repository type and settings.
    /// </summary>
    public class SmartConfigOptions
    {
        private IConfigurationRepository _repository;
        internal string _configKey;

        /// <summary>
        /// Configures the smart configuration to use PostgreSQL as the configuration store.
        /// </summary>
        /// <param name="configKey">The configuration key used to find the connection string</param>
        /// <returns>The configuration options instance for method chaining</returns>
        public SmartConfigOptions UsePostgres(string configKey)
        {
            _configKey = configKey;
            _repository = new Repositories.PostgresConfigurationRepository();
            return this;
        }
        /// <summary>
        /// Configures the smart configuration to use SQL Server as the configuration store.
        /// </summary>
        /// <returns>The configuration options instance for method chaining</returns>
        /// <exception cref="NotImplementedException">This feature is not yet implemented</exception>
        public SmartConfigOptions UseSqlServer()
        {
            throw new NotImplementedException();
        }
        /// <summary>
        /// Configures the smart configuration to use a custom configuration repository.
        /// </summary>
        /// <param name="repository">The configuration repository to use</param>
        /// <returns>The configuration options instance for method chaining</returns>
        public SmartConfigOptions UseRepository(IConfigurationRepository repository)
        {
            _repository = repository;
            return this;
        }

        internal IConfigurationRepository GetRepository() => _repository;
    }
}