using Lada.Framework.Infrastructures.Services;

namespace Ladaer.BackEnd.Infrastructures.Services
{
    /// <summary>
    /// Adapter để chuyển đổi Framework IAppConfigService thành Backend IAppConfigService
    /// (Backward compatibility)
    /// </summary>
    public class BackendAppConfigServiceAdapter : Ladaer.BackEnd.Infrastructures.Services.IAppConfigService
    {
        private readonly Lada.Framework.Infrastructures.Services.IAppConfigService _frameworkService;

        public BackendAppConfigServiceAdapter(Lada.Framework.Infrastructures.Services.IAppConfigService frameworkService)
        {
            _frameworkService = frameworkService;
        }

        public async Task<string> GetConfigValueAsync(string key)
        {
            return await _frameworkService.GetConfigValueAsync(key);
        }

        public async Task LoadConfigsToCacheAsync()
        {
            await _frameworkService.LoadConfigsToCacheAsync();
        }
    }
}
