namespace Infrastructure.Verticals.Notifications; public class NotificationFactory : INotificationFactory { private readonly IEnumerable _providers; public NotificationFactory(IEnumerable providers) { _providers = providers; } protected List ActiveProviders() => _providers .Where(x => x.Config.IsValid()) .Where(provider => provider.Config.IsEnabled) .ToList(); public List OnFailedImportStrikeEnabled() => ActiveProviders() .Where(n => n.Config.OnImportFailedStrike) .ToList(); public List OnStalledStrikeEnabled() => ActiveProviders() .Where(n => n.Config.OnStalledStrike) .ToList(); public List OnQueueItemDeletedEnabled() => ActiveProviders() .Where(n => n.Config.OnQueueItemDeleted) .ToList(); public List OnDownloadCleanedEnabled() => ActiveProviders() .Where(n => n.Config.OnDownloadCleaned) .ToList(); }