Пример #1
0
 public ProviderEmailLookupService(
     ILogger logger,
     IdamsEmailServiceWrapper idamsEmailServiceWrapper,
     EmployerApprenticeshipsServiceConfiguration employerConfiguration,
     IApprenticeshipInfoServiceWrapper apprenticeshipInfoService)
 {
     _logger = logger;
     _idamsEmailServiceWrapper  = idamsEmailServiceWrapper;
     _apprenticeshipInfoService = apprenticeshipInfoService;
     _configuration             = employerConfiguration.CommitmentNotification;
 }
 public IdamsEmailServiceWrapper(
     ILog logger,
     EmployerCommitmentsServiceConfiguration configuration,
     IHttpClientWrapper httpClient,
     [RequiredPolicy(IdamsExecutionPolicy.Name)] ExecutionPolicy executionPolicy)
 {
     _logger            = logger;
     _configuration     = configuration.CommitmentNotification;
     _httpClientWrapper = httpClient;
     _executionPolicy   = executionPolicy;
 }
Пример #3
0
 private void ConfigureEmailWrapper(CommitmentNotificationConfiguration config)
 {
     if (config.UseIdamsService)
     {
         For <IProviderEmailServiceWrapper>().Use <IdamsEmailServiceWrapper>();
     }
     else
     {
         For <IProviderEmailServiceWrapper>().Use <FakeProviderEmailServiceWrapper>();
     }
 }
Пример #4
0
 public NotificationJob(
     IEmployerEmailTemplatesService emailTemplatesService,
     IProviderEmailTemplatesService providerEmailTemplatesService,
     INotificationsApi notificationsApi,
     ILog logger,
     CommitmentNotificationConfiguration config
     )
 {
     _emailTemplatesService         = emailTemplatesService;
     _providerEmailTemplatesService = providerEmailTemplatesService;
     _notificationsApi = notificationsApi;
     _logger           = logger;
     _config           = config;
 }
 public NotificationJob(
     IEmployerAlertSummaryEmailService employerAlertsEmailService,
     IProviderAlertSummaryEmailService providerAlertsEmailService,
     ISendingEmployerTransferRequestEmailService sendingEmployerTransferRequestEmailService,
     INotificationsApi notificationsApi,
     ILog logger,
     CommitmentNotificationConfiguration config)
 {
     _employerAlertsEmailService = employerAlertsEmailService;
     _providerAlertsEmailService = providerAlertsEmailService;
     _sendingEmployerTransferRequestEmailService = sendingEmployerTransferRequestEmailService;
     _notificationsApi = notificationsApi;
     _logger           = logger;
     _config           = config;
 }
Пример #6
0
        private void ConfigureNotificationsApi(CommitmentNotificationConfiguration config)
        {
            HttpClient httpClient;

            if (string.IsNullOrWhiteSpace(config.NotificationApi.ClientId))
            {
                httpClient = new Http.HttpClientBuilder()
                             .WithBearerAuthorisationHeader(new JwtBearerTokenGenerator(config.NotificationApi))
                             .WithHandler(new SessionIdMessageRequestHandler())
                             .WithDefaultHeaders()
                             .Build();
            }
            else
            {
                httpClient = new Http.HttpClientBuilder()
                             .WithBearerAuthorisationHeader(new AzureADBearerTokenGenerator(config.NotificationApi))
                             .Build();
            }

            For <INotificationsApi>().Use <NotificationsApi>().Ctor <HttpClient>().Is(httpClient);

            For <INotificationsApiClientConfiguration>().Use(config.NotificationApi);
        }
 public FakeProviderEmailServiceWrapper(CommitmentNotificationConfiguration config)
 {
     _config = config;
 }