public AuditDataCleanUpService(IScheduledJobsConfiguration config, IPaymentsDataContext dataContext, IEndpointInstanceFactory endpointInstanceFactory, IPaymentLogger paymentLogger)
 {
     this.dataContext             = dataContext ?? throw new ArgumentNullException(nameof(dataContext));
     this.endpointInstanceFactory = endpointInstanceFactory ?? throw new ArgumentNullException(nameof(endpointInstanceFactory));
     this.config        = config ?? throw new ArgumentNullException(nameof(config));
     this.paymentLogger = paymentLogger ?? throw new ArgumentNullException(nameof(paymentLogger));
 }
Exemplo n.º 2
0
 public PeriodEndJobContextMessageHandler(IPaymentLogger logger,
                                          IEndpointInstanceFactory endpointInstanceFactory, IPeriodEndJobClient jobClient, IJobStatusService jobStatusService)
 {
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.endpointInstanceFactory = endpointInstanceFactory ??
                                    throw new ArgumentNullException(nameof(endpointInstanceFactory));
     this.jobClient        = jobClient ?? throw new ArgumentNullException(nameof(jobClient));
     this.jobStatusService = jobStatusService ?? throw new ArgumentNullException(nameof(jobStatusService));
 }
Exemplo n.º 3
0
 public ManageLevyAccountBalanceService(IAccountApiClient accountApiClient,
                                        IPaymentLogger logger,
                                        ILevyAccountBulkCopyRepository levyAccountBulkWriter,
                                        ILevyFundingSourceRepository levyFundingSourceRepository,
                                        int batchSize,
                                        IEndpointInstanceFactory endpointInstanceFactory)
 {
     this.accountApiClient            = accountApiClient ?? throw new ArgumentNullException(nameof(accountApiClient));
     this.logger                      = logger ?? throw new ArgumentNullException(nameof(logger));
     this.levyAccountBulkWriter       = levyAccountBulkWriter ?? throw new ArgumentNullException(nameof(levyAccountBulkWriter));
     this.levyFundingSourceRepository = levyFundingSourceRepository ?? throw new ArgumentNullException(nameof(levyFundingSourceRepository));
     this.batchSize                   = batchSize;
     this.endpointInstanceFactory     = endpointInstanceFactory ?? throw new ArgumentNullException(nameof(endpointInstanceFactory));
 }
Exemplo n.º 4
0
        private static async Task RunLevyAccountImport(IEndpointInstanceFactory endpointInstanceFactory, IScheduledJobsConfiguration config, IPaymentLogger log)
        {
            try
            {
                var command          = new ImportEmployerAccounts();
                var endpointInstance = await endpointInstanceFactory.GetEndpointInstance().ConfigureAwait(false);

                await endpointInstance.Send(config.LevyAccountBalanceEndpoint, command).ConfigureAwait(false);
            }
            catch (Exception e)
            {
                log.LogError("Error in LevyAccountImport", e);
                throw;
            }
        }
        public ManageLevyAccountBalanceService(ILevyFundingSourceRepository repository,
                                               IAccountApiClient accountApiClient,
                                               IPaymentLogger logger,
                                               ILevyAccountBulkCopyRepository levyAccountBulkWriter,
                                               int batchSize,
                                               IEndpointInstanceFactory endpointInstanceFactory)
        {
            this.repository              = repository;
            this.accountApiClient        = accountApiClient;
            this.logger                  = logger;
            this.levyAccountBulkWriter   = levyAccountBulkWriter;
            this.batchSize               = batchSize;
            this.endpointInstanceFactory = endpointInstanceFactory;

            retryPolicy = Policy.Handle <Exception>().WaitAndRetryAsync(5, i => TimeSpan.FromMinutes(1));
        }
Exemplo n.º 6
0
 public ApprenticeshipProcessor(IPaymentLogger logger, IMapper mapper,
                                IApprenticeshipService apprenticeshipService,
                                IEndpointInstanceFactory endpointInstanceFactory,
                                IApprenticeshipApprovedUpdatedService apprenticeshipApprovedUpdatedService,
                                IApprenticeshipDataLockTriageService apprenticeshipDataLockTriageService,
                                IApprenticeshipStoppedService apprenticeshipStoppedService,
                                IApprenticeshipPauseService apprenticeshipPauseService,
                                IApprenticeshipResumedService apprenticeshipResumedService)
 {
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.apprenticeshipService   = apprenticeshipService ?? throw new ArgumentNullException(nameof(apprenticeshipService));
     this.endpointInstanceFactory = endpointInstanceFactory ?? throw new ArgumentNullException(nameof(endpointInstanceFactory));
     this.apprenticeshipApprovedUpdatedService = apprenticeshipApprovedUpdatedService ?? throw new ArgumentNullException(nameof(apprenticeshipApprovedUpdatedService));
     this.apprenticeshipDataLockTriageService  = apprenticeshipDataLockTriageService ?? throw new ArgumentNullException(nameof(apprenticeshipDataLockTriageService));
     this.apprenticeshipStoppedService         = apprenticeshipStoppedService ?? throw new ArgumentNullException(nameof(apprenticeshipStoppedService));
     this.apprenticeshipPauseService           = apprenticeshipPauseService ?? throw new ArgumentNullException(nameof(apprenticeshipPauseService));
     this.apprenticeshipResumedService         = apprenticeshipResumedService ?? throw new ArgumentNullException(nameof(apprenticeshipResumedService));
 }
Exemplo n.º 7
0
 public JobContextMessageHandler(IPaymentLogger logger,
                                 IFileService azureFileService,
                                 IJsonSerializationService serializationService,
                                 IEndpointInstanceFactory factory,
                                 IEarningsJobClientFactory jobClientFactory,
                                 ITelemetry telemetry,
                                 IBulkWriter <SubmittedLearnerAimModel> submittedAimWriter,
                                 ISubmittedLearnerAimBuilder submittedLearnerAimBuilder,
                                 ISubmittedLearnerAimRepository submittedLearnerAimRepository,
                                 IJobStatusService jobStatusService)
 {
     this.logger                        = logger ?? throw new ArgumentNullException(nameof(logger));
     this.azureFileService              = azureFileService ?? throw new ArgumentNullException(nameof(azureFileService));
     this.serializationService          = serializationService ?? throw new ArgumentNullException(nameof(serializationService));
     this.factory                       = factory ?? throw new ArgumentNullException(nameof(factory));
     this.jobClientFactory              = jobClientFactory ?? throw new ArgumentNullException(nameof(jobClientFactory));
     this.telemetry                     = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
     this.submittedAimWriter            = submittedAimWriter;
     this.submittedLearnerAimBuilder    = submittedLearnerAimBuilder;
     this.submittedLearnerAimRepository = submittedLearnerAimRepository;
     this.jobStatusService              = jobStatusService;
 }
Exemplo n.º 8
0
 public static async Task HttpLevyAccountImport([HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req, [Inject] IEndpointInstanceFactory endpointInstanceFactory, [Inject] IScheduledJobsConfiguration config, [Inject] IPaymentLogger log)
 {
     await RunLevyAccountImport(endpointInstanceFactory, config, log);
 }
Exemplo n.º 9
0
 public static async Task Run([TimerTrigger("%LevyAccountSchedule%", RunOnStartup = false)] TimerInfo myTimer, [Inject] IEndpointInstanceFactory endpointInstanceFactory, [Inject] IScheduledJobsConfiguration config, [Inject] IPaymentLogger log)
 {
     await RunLevyAccountImport(endpointInstanceFactory, config, log);
 }
 public JobStatusEventPublisher(IEndpointInstanceFactory factory, IPaymentLogger logger)
 {
     this.factory = factory ?? throw new ArgumentNullException(nameof(factory));
     this.logger  = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 11
0
 public StatelessEndpointCommunicationListener(IEndpointInstanceFactory endpointInstanceFactory, IApplicationConfiguration config, IPaymentLogger logger)
 {
     this.endpointInstanceFactory = endpointInstanceFactory ?? throw new ArgumentNullException(nameof(endpointInstanceFactory));
     this.config = config ?? throw new ArgumentNullException(nameof(config));
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 12
0
 public StatefulEndpointCommunicationListener(IEndpointInstanceFactory endpointInstanceFactory, IApplicationConfiguration config)
 {
     this.endpointInstanceFactory = endpointInstanceFactory ?? throw new ArgumentNullException(nameof(endpointInstanceFactory));
     this.config = config ?? throw new ArgumentNullException(nameof(config));
 }