Пример #1
0
 public ApprenticeshipUpdatedProcessor(IPaymentLogger logger,
                                       IActorDataCache <List <ApprenticeshipModel> > dataCache,
                                       IMapper mapper,
                                       IActorDataCache <List <long> > ukprnCache)
 {
     this.logger     = logger ?? throw new ArgumentNullException(nameof(logger));
     this.dataCache  = dataCache ?? throw new ArgumentNullException(nameof(dataCache));
     this.mapper     = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.ukprnCache = ukprnCache ?? throw new ArgumentNullException(nameof(ukprnCache));
 }
Пример #2
0
        protected override async Task OnActivateAsync()
        {
            using (var operation = telemetry.StartOperation("LevyFundedService.OnActivateAsync", $"{Id}_{Guid.NewGuid():N}"))
            {
                var stopwatch = Stopwatch.StartNew();
                //TODO: Use DI
                actorCache = new ActorReliableCollectionCache <bool>(StateManager);
                employerProviderPriorities = new ReliableCollectionCache <List <EmployerProviderPriorityModel> >(StateManager);
                requiredPaymentsCache      = new ReliableCollectionCache <CalculatedRequiredLevyAmount>(StateManager);
                monthEndCache                = new ReliableCollectionCache <bool>(StateManager);
                levyAccountCache             = new ReliableCollectionCache <LevyAccountModel>(StateManager);
                refundSortKeysCache          = new ReliableCollectionCache <List <string> >(StateManager);
                transferPaymentSortKeysCache = new ReliableCollectionCache <List <TransferPaymentSortKeyModel> >(StateManager);
                requiredPaymentSortKeysCache = new ReliableCollectionCache <List <RequiredPaymentSortKeyModel> >(StateManager);

                generateSortedPaymentKeys = new GenerateSortedPaymentKeys(
                    employerProviderPriorities,
                    refundSortKeysCache,
                    transferPaymentSortKeysCache,
                    requiredPaymentSortKeysCache
                    );

                fundingSourceService = new RequiredLevyAmountFundingSourceService(
                    lifetimeScope.Resolve <IPaymentProcessor>(),
                    lifetimeScope.Resolve <IMapper>(),
                    requiredPaymentsCache,
                    lifetimeScope.Resolve <ILevyFundingSourceRepository>(),
                    lifetimeScope.Resolve <ILevyBalanceService>(),
                    lifetimeScope.Resolve <IPaymentLogger>(),
                    monthEndCache,
                    levyAccountCache,
                    employerProviderPriorities,
                    refundSortKeysCache,
                    transferPaymentSortKeysCache,
                    requiredPaymentSortKeysCache,
                    generateSortedPaymentKeys
                    );

                await Initialise().ConfigureAwait(false);

                await base.OnActivateAsync().ConfigureAwait(false);

                TrackInfrastructureEvent("LevyFundedService.OnActivateAsync", stopwatch);
                telemetry.StopOperation(operation);
            }
        }
        protected override async Task OnActivateAsync()
        {
            using (var operation =
                       telemetry.StartOperation("LevyFundedService.OnActivateAsync", $"{Id}_{Guid.NewGuid():N}"))
            {
                var stopwatch = Stopwatch.StartNew();
                //TODO: Use DI
                actorCache = new ActorReliableCollectionCache <bool>(StateManager);

                monthEndCache    = new ReliableCollectionCache <bool>(StateManager);
                levyAccountCache = new ReliableCollectionCache <LevyAccountModel>(StateManager);

                var logger             = lifetimeScope.Resolve <IPaymentLogger>();
                var levyBalanceService = lifetimeScope.Resolve <ILevyBalanceService>();

                fundingSourceEventGenerationService = new FundingSourceEventGenerationService(
                    logger,
                    lifetimeScope.Resolve <IFundingSourceDataContext>(),
                    levyBalanceService,
                    lifetimeScope.Resolve <ILevyFundingSourceRepository>(),
                    levyAccountCache,
                    lifetimeScope.Resolve <ICalculatedRequiredLevyAmountPrioritisationService>(),
                    lifetimeScope.Resolve <IFundingSourcePaymentEventBuilder>()
                    );
                transferFundingSourceEventGenerationService = new TransferFundingSourceEventGenerationService(
                    logger,
                    lifetimeScope.Resolve <IMapper>(),
                    monthEndCache,
                    levyAccountCache,
                    levyBalanceService,
                    lifetimeScope.Resolve <IFundingSourcePaymentEventBuilder>(),
                    lifetimeScope.Resolve <ILevyTransactionBatchStorageService>()
                    );

                await Initialise().ConfigureAwait(false);

                await base.OnActivateAsync().ConfigureAwait(false);

                TrackInfrastructureEvent("LevyFundedService.OnActivateAsync", stopwatch);
                telemetry.StopOperation(operation);
            }
        }
Пример #4
0
 public DataLockService(
     ActorService actorService,
     ActorId actorId,
     IPaymentLogger paymentLogger,
     Func <IApprenticeshipRepository> apprenticeshipRepository,
     IActorDataCache <List <ApprenticeshipModel> > apprenticeships,
     IActorDataCache <List <long> > providers,
     IDataLockProcessor dataLockProcessor,
     IApprenticeshipUpdatedProcessor apprenticeshipUpdatedProcessor,
     ITelemetry telemetry
     )
     : base(actorService, actorId)
 {
     this.paymentLogger            = paymentLogger;
     this.apprenticeshipRepository = apprenticeshipRepository;
     this.apprenticeships          = apprenticeships;
     this.providers         = providers ?? throw new ArgumentNullException(nameof(providers));
     this.dataLockProcessor = dataLockProcessor;
     this.apprenticeshipUpdatedProcessor = apprenticeshipUpdatedProcessor ?? throw new ArgumentNullException(nameof(apprenticeshipUpdatedProcessor));
     this.telemetry = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
 }
 public DuplicateEarningEventService(IPaymentLogger logger, IActorDataCache <EarningEventKey> cache)
 {
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.cache  = cache ?? throw new ArgumentNullException(nameof(cache));
 }
 public DataLockLearnerCache(IActorDataCache <List <ApprenticeshipModel> > dataCache, IActorDataCache <List <long> > ukprnCache)
 {
     this.dataCache  = dataCache ?? throw new ArgumentNullException(nameof(dataCache));
     this.ukprnCache = ukprnCache ?? throw new ArgumentNullException(nameof(ukprnCache));
 }