using Microsoft.Extensions.Configuration;
using Shared.DTO;
using DAL;

namespace BLL
{
    public class EnvioDGA
    {
        private readonly IConfiguration _configuration;
        private readonly MedicionScadaRepository _dGAMedicionScadaRepository;

        public EnvioDGA(IConfiguration configuration, MedicionScadaRepository dGAMedicionScadaRepository)
        {
            _configuration = configuration ?? new ConfigurationBuilder()
                .SetBasePath(AppContext.BaseDirectory)
                .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                .Build();

            _dGAMedicionScadaRepository = dGAMedicionScadaRepository;
        }

        public async Task<List<MedicionScada>> ObtenerMedicionesAsync()
        {
            return await _dGAMedicionScadaRepository.ObtenerMedicionesAsync();
        }
    }
}
