using Hotline.CallCenter.Ivrs;
using Hotline.Repository.SqlSugar.DataPermissions;
using SqlSugar;
using XF.Domain.Dependency;

namespace Hotline.Repository.SqlSugar.CallCenter
{
    public class IvrRepository : BaseRepository<Ivr>, IIvrRepository, IScopeDependency
    {
        public IvrRepository(ISugarUnitOfWork<HotlineDbContext> uow, IDataPermissionFilterBuilder dataPermissionFilterBuilder, IServiceProvider serviceProvider) : base(uow, dataPermissionFilterBuilder, serviceProvider)
        {
        }

        public async Task UpdateWithoutStrategiesAsync(Ivr ivr, CancellationToken cancellationToken = default)
        {
            await Db.Updateable(ivr).IgnoreColumns(d => d.IvrStrategies).ExecuteCommandAsync();
        }
    }
}
