public ProviderCalculationResultsReIndexerService(
            ILogger logger,
            ISearchRepository <ProviderCalculationResultsIndex> providerCalculationResultsSearchRepository,
            ISpecificationsApiClient specificationsApiClient,
            ICalculationResultsRepository resultsRepository,
            IResultsResiliencePolicies resiliencePolicies,
            IFeatureToggle featureToggle,
            IMessengerService messengerService)
        {
            Guard.ArgumentNotNull(logger, nameof(logger));
            Guard.ArgumentNotNull(providerCalculationResultsSearchRepository, nameof(providerCalculationResultsSearchRepository));
            Guard.ArgumentNotNull(specificationsApiClient, nameof(specificationsApiClient));
            Guard.ArgumentNotNull(resultsRepository, nameof(resultsRepository));
            Guard.ArgumentNotNull(resiliencePolicies?.ResultsRepository, nameof(resiliencePolicies.ResultsRepository));
            Guard.ArgumentNotNull(resiliencePolicies?.SpecificationsApiClient, nameof(resiliencePolicies.SpecificationsApiClient));
            Guard.ArgumentNotNull(resiliencePolicies?.ResultsSearchRepository, nameof(resiliencePolicies.ResultsSearchRepository));
            Guard.ArgumentNotNull(featureToggle, nameof(featureToggle));
            Guard.ArgumentNotNull(messengerService, nameof(messengerService));

            _logger = logger;
            _providerCalculationResultsSearchRepository = providerCalculationResultsSearchRepository;
            _specificationsApiClient       = specificationsApiClient;
            _resultsRepository             = resultsRepository;
            _resultsRepositoryPolicy       = resiliencePolicies.ResultsRepository;
            _specificationsApiClientPolicy = resiliencePolicies.SpecificationsApiClient;
            _resultsSearchRepositoryPolicy = resiliencePolicies.ResultsSearchRepository;
            _featureToggle    = featureToggle;
            _messengerService = messengerService;
        }
コード例 #2
0
 public CalculationProviderResultsSearchService(ILogger logger,
                                                ISearchRepository <CalculationProviderResultsIndex> searchRepository,
                                                IResultsResiliencePolicies resiliencePolicies)
 {
     _logger                 = logger;
     _searchRepository       = searchRepository;
     _searchRepositoryPolicy = resiliencePolicies.CalculationProviderResultsSearchRepository;
 }
コード例 #3
0
 static ResultsSearchService CreateResultsSearchService(
     ILogger logger = null,
     ISearchRepository <ProviderIndex> searchRepository = null,
     IResultsResiliencePolicies resiliencePolicies      = null)
 {
     return(new ResultsSearchService(
                logger ?? CreateLogger(),
                searchRepository ?? CreateSearchRepository(),
                resiliencePolicies ?? ResultsResilienceTestHelper.GenerateTestPolicies()));
 }
        public AllocationNotificationsFeedsSearchService(
            ISearchRepository <AllocationNotificationFeedIndex> allocationNotificationsSearchRepository,
            IResultsResiliencePolicies resiliencePolicies)
        {
            Guard.ArgumentNotNull(allocationNotificationsSearchRepository, nameof(allocationNotificationsSearchRepository));
            Guard.ArgumentNotNull(resiliencePolicies, nameof(resiliencePolicies));

            _allocationNotificationsSearchRepository       = allocationNotificationsSearchRepository;
            _allocationNotificationsSearchRepositoryPolicy = resiliencePolicies.AllocationNotificationFeedSearchRepository;
        }
コード例 #5
0
 public ProviderCalculationResultsSearchService(ILogger logger,
                                                ISearchRepository <ProviderCalculationResultsIndex> searchRepository,
                                                IResultsResiliencePolicies resiliencePolicies,
                                                IFeatureToggle featureToggle)
 {
     _logger                 = logger;
     _searchRepository       = searchRepository;
     _searchRepositoryPolicy = resiliencePolicies.ProviderCalculationResultsSearchRepository;
     _featureToggle          = featureToggle;
 }
コード例 #6
0
        public ResultsService(ILogger logger,
                              IFeatureToggle featureToggle,
                              ICalculationResultsRepository resultsRepository,
                              IMapper mapper,
                              ISearchRepository <ProviderIndex> searchRepository,
                              ITelemetry telemetry,
                              IProviderSourceDatasetRepository providerSourceDatasetRepository,
                              ISearchRepository <ProviderCalculationResultsIndex> calculationProviderResultsSearchRepository,
                              ISpecificationsRepository specificationsRepository,
                              IResultsResiliencePolicies resiliencePolicies,
                              IProviderImportMappingService providerImportMappingService,
                              ICacheProvider cacheProvider,
                              IMessengerService messengerService,
                              ICalculationsRepository calculationRepository,
                              IValidator <MasterProviderModel> masterProviderModelValidator,
                              IBlobClient blobClient)
        {
            Guard.ArgumentNotNull(resultsRepository, nameof(resultsRepository));
            Guard.ArgumentNotNull(mapper, nameof(mapper));
            Guard.ArgumentNotNull(searchRepository, nameof(searchRepository));
            Guard.ArgumentNotNull(telemetry, nameof(telemetry));
            Guard.ArgumentNotNull(providerSourceDatasetRepository, nameof(providerSourceDatasetRepository));
            Guard.ArgumentNotNull(calculationProviderResultsSearchRepository, nameof(calculationProviderResultsSearchRepository));
            Guard.ArgumentNotNull(specificationsRepository, nameof(specificationsRepository));
            Guard.ArgumentNotNull(resiliencePolicies, nameof(resiliencePolicies));
            Guard.ArgumentNotNull(providerImportMappingService, nameof(providerImportMappingService));
            Guard.ArgumentNotNull(cacheProvider, nameof(cacheProvider));
            Guard.ArgumentNotNull(messengerService, nameof(messengerService));
            Guard.ArgumentNotNull(calculationRepository, nameof(calculationRepository));
            Guard.ArgumentNotNull(masterProviderModelValidator, nameof(masterProviderModelValidator));
            Guard.ArgumentNotNull(featureToggle, nameof(featureToggle));
            Guard.ArgumentNotNull(blobClient, nameof(blobClient));

            _logger            = logger;
            _resultsRepository = resultsRepository;
            _mapper            = mapper;
            _searchRepository  = searchRepository;
            _telemetry         = telemetry;
            _providerSourceDatasetRepository            = providerSourceDatasetRepository;
            _calculationProviderResultsSearchRepository = calculationProviderResultsSearchRepository;
            _resultsRepositoryPolicy        = resiliencePolicies.ResultsRepository;
            _specificationsRepository       = specificationsRepository;
            _resultsSearchRepositoryPolicy  = resiliencePolicies.ResultsSearchRepository;
            _specificationsRepositoryPolicy = resiliencePolicies.SpecificationsRepository;
            _providerImportMappingService   = providerImportMappingService;
            _cacheProvider                = cacheProvider;
            _messengerService             = messengerService;
            _calculationRepository        = calculationRepository;
            _masterProviderModelValidator = masterProviderModelValidator;
            _calculationsRepositoryPolicy = resiliencePolicies.CalculationsRepository;
            _featureToggle                = featureToggle;
            _blobClient       = blobClient;
            _blobClientPolicy = resiliencePolicies.CsvBlobPolicy;
        }
コード例 #7
0
        public ResultsSearchService(ILogger logger,
                                    ISearchRepository <ProviderIndex> searchRepository,
                                    IResultsResiliencePolicies resiliencePolicies)
        {
            Guard.ArgumentNotNull(searchRepository, nameof(searchRepository));
            Guard.ArgumentNotNull(logger, nameof(logger));

            _logger           = logger;
            _searchRepository = searchRepository;
            _resultsSearchRepositoryPolicy = resiliencePolicies.ResultsSearchRepository;
        }
 static CalculationProviderResultsSearchService CreateTestResultsSearchService(
     ILogger logger = null,
     ISearchRepository <CalculationProviderResultsIndex> serachRepository = null,
     IResultsResiliencePolicies resiliencePolicies = null,
     ISearchRepository <ProviderCalculationResultsIndex> providerCalculationResultsSearchRepository = null,
     IFeatureToggle featureToggle = null)
 {
     return(new CalculationProviderResultsSearchService(
                logger ?? CreateLogger(),
                serachRepository ?? CreateSearchRepository(),
                resiliencePolicies ?? ResultsResilienceTestHelper.GenerateTestPolicies()));
 }
コード例 #9
0
        static ProviderCalculationResultsSearchService CreateTestResultsSearchService(
            ILogger logger = null,
            ISearchRepository <ProviderCalculationResultsIndex> serachRepository = null,
            IResultsResiliencePolicies resiliencePolicies = null)
        {
            IFeatureToggle featureToggle = Substitute.For <IFeatureToggle>();

            featureToggle.IsExceptionMessagesEnabled().Returns(true);
            return(new ProviderCalculationResultsSearchService(
                       logger ?? CreateLogger(),
                       serachRepository ?? CreateSearchRepository(),
                       resiliencePolicies ?? ResultsResilienceTestHelper.GenerateTestPolicies(),
                       featureToggle));
        }
        public ProviderCalculationResultsSearchService(ILogger logger,
                                                       ISearchRepository <ProviderCalculationResultsIndex> searchRepository,
                                                       IResultsResiliencePolicies resiliencePolicies,
                                                       IFeatureToggle featureToggle)
        {
            Guard.ArgumentNotNull(logger, nameof(logger));
            Guard.ArgumentNotNull(searchRepository, nameof(searchRepository));
            Guard.ArgumentNotNull(resiliencePolicies?.ProviderCalculationResultsSearchRepository, nameof(resiliencePolicies.ProviderCalculationResultsSearchRepository));
            Guard.ArgumentNotNull(featureToggle, nameof(featureToggle));

            _logger                 = logger;
            _searchRepository       = searchRepository;
            _searchRepositoryPolicy = resiliencePolicies.ProviderCalculationResultsSearchRepository;
            _featureToggle          = featureToggle;
        }
 public MergeSpecificationsWithProviderResultsDocuments(ICosmosRepository cosmosRepository,
                                                        ILogger logger,
                                                        ISpecificationsApiClient specifications,
                                                        IProducerConsumerFactory producerConsumerFactory,
                                                        IResultsResiliencePolicies resultsResiliencePolicies,
                                                        IPoliciesApiClient policies,
                                                        ICalculationResultsRepository results)
 {
     _cosmosRepository        = cosmosRepository;
     _logger                  = logger;
     _specifications          = specifications;
     _producerConsumerFactory = producerConsumerFactory;
     _policies                = policies;
     _results                 = results;
     _policiesPolicy          = resultsResiliencePolicies.PoliciesApiClient;
 }
コード例 #12
0
        public ResultsService(ILogger logger,
                              IFeatureToggle featureToggle,
                              ICalculationResultsRepository resultsRepository,
                              IProviderSourceDatasetRepository providerSourceDatasetRepository,
                              ISearchRepository <ProviderCalculationResultsIndex> calculationProviderResultsSearchRepository,
                              ISpecificationsApiClient specificationsApiClient,
                              ICalculationsApiClient calculationsApiClient,
                              IResultsResiliencePolicies resiliencePolicies,
                              ICalculationsRepository calculationRepository,
                              IMapper mapper,
                              IJobManagement jobManagement,
                              IBlobClient blobClient) : base(jobManagement, logger)
        {
            Guard.ArgumentNotNull(resultsRepository, nameof(resultsRepository));
            Guard.ArgumentNotNull(providerSourceDatasetRepository, nameof(providerSourceDatasetRepository));
            Guard.ArgumentNotNull(calculationProviderResultsSearchRepository, nameof(calculationProviderResultsSearchRepository));
            Guard.ArgumentNotNull(specificationsApiClient, nameof(specificationsApiClient));
            Guard.ArgumentNotNull(calculationsApiClient, nameof(calculationsApiClient));
            Guard.ArgumentNotNull(resiliencePolicies?.ResultsRepository, nameof(resiliencePolicies.ResultsRepository));
            Guard.ArgumentNotNull(resiliencePolicies?.ResultsSearchRepository, nameof(resiliencePolicies.ResultsSearchRepository));
            Guard.ArgumentNotNull(resiliencePolicies?.SpecificationsApiClient, nameof(resiliencePolicies.SpecificationsApiClient));
            Guard.ArgumentNotNull(resiliencePolicies?.CalculationsApiClient, nameof(resiliencePolicies.CalculationsApiClient));
            Guard.ArgumentNotNull(resiliencePolicies?.CalculationsRepository, nameof(resiliencePolicies.CalculationsRepository));
            Guard.ArgumentNotNull(resiliencePolicies?.BlobClient, nameof(resiliencePolicies.BlobClient));
            Guard.ArgumentNotNull(calculationRepository, nameof(calculationRepository));
            Guard.ArgumentNotNull(featureToggle, nameof(featureToggle));
            Guard.ArgumentNotNull(mapper, nameof(mapper));
            Guard.ArgumentNotNull(blobClient, nameof(blobClient));

            _logger            = logger;
            _mapper            = mapper;
            _resultsRepository = resultsRepository;
            _providerSourceDatasetRepository            = providerSourceDatasetRepository;
            _calculationProviderResultsSearchRepository = calculationProviderResultsSearchRepository;
            _resultsRepositoryPolicy       = resiliencePolicies.ResultsRepository;
            _specificationsApiClient       = specificationsApiClient;
            _calculationsApiClient         = calculationsApiClient;
            _resultsSearchRepositoryPolicy = resiliencePolicies.ResultsSearchRepository;
            _specificationsApiClientPolicy = resiliencePolicies.SpecificationsApiClient;
            _calculationsApiClientPolicy   = resiliencePolicies.CalculationsApiClient;
            _blobClientPolicy             = resiliencePolicies.BlobClient;
            _calculationRepository        = calculationRepository;
            _calculationsRepositoryPolicy = resiliencePolicies.CalculationsRepository;
            _featureToggle = featureToggle;
            _blobClient    = blobClient;
        }
コード例 #13
0
        static PublishedResultsService CreateResultsService(ILogger logger       = null,
                                                            IMapper mapper       = null,
                                                            ITelemetry telemetry = null,
                                                            ICalculationResultsRepository resultsRepository    = null,
                                                            ISpecificationsRepository specificationsRepository = null,
                                                            IResultsResiliencePolicies resiliencePolicies      = null,
                                                            IPublishedProviderResultsAssemblerService publishedProviderResultsAssemblerService = null,
                                                            IPublishedProviderResultsRepository publishedProviderResultsRepository             = null,
                                                            ICacheProvider cacheProvider = null,
                                                            ISearchRepository <AllocationNotificationFeedIndex> allocationNotificationFeedSearchRepository = null,
                                                            IProfilingApiClient profilingApiClient = null,
                                                            IMessengerService messengerService     = null,
                                                            IVersionRepository <PublishedAllocationLineResultVersion> publishedProviderResultsVersionRepository    = null,
                                                            IPublishedAllocationLineLogicalResultVersionService publishedAllocationLineLogicalResultVersionService = null,
                                                            IFeatureToggle featureToggle = null,
                                                            IJobsApiClient jobsApiClient = null,
                                                            IPublishedProviderResultsSettings publishedProviderResultsSettings = null,
                                                            IProviderChangesRepository providerChangesRepository = null,
                                                            IProviderVariationsService providerVariationsService = null,
                                                            IProviderVariationsStorageRepository providerVariationsStorageRepository = null)
        {
            ISpecificationsRepository specsRepo = specificationsRepository ?? CreateSpecificationsRepository();

            return(new PublishedResultsService(
                       logger ?? CreateLogger(),
                       mapper ?? CreateMapper(),
                       telemetry ?? CreateTelemetry(),
                       resultsRepository ?? CreateResultsRepository(),
                       specsRepo,
                       resiliencePolicies ?? ResultsResilienceTestHelper.GenerateTestPolicies(),
                       publishedProviderResultsAssemblerService ?? CreateResultsAssembler(),
                       publishedProviderResultsRepository ?? CreatePublishedProviderResultsRepository(),
                       cacheProvider ?? CreateCacheProvider(),
                       allocationNotificationFeedSearchRepository ?? CreateAllocationNotificationFeedSearchRepository(),
                       profilingApiClient ?? CreateProfilingRepository(),
                       messengerService ?? CreateMessengerService(),
                       publishedProviderResultsVersionRepository ?? CreatePublishedProviderResultsVersionRepository(),
                       publishedAllocationLineLogicalResultVersionService ?? CreatePublishedAllocationLineLogicalResultVersionService(),
                       featureToggle ?? CreateFeatureToggle(),
                       jobsApiClient ?? CreateJobsApiClient(),
                       publishedProviderResultsSettings ?? CreatePublishedProviderResultsSettings(),
                       providerChangesRepository ?? CreateProviderChangesRepository(),
                       providerVariationsService ?? CreateProviderVariationsService(CreateProviderVariationAssemblerService(), specsRepo),
                       providerVariationsStorageRepository ?? CreateProviderVariationsStorageRepository()
                       ));
        }
        public ProviderResultsCsvGeneratorService(ILogger logger,
                                                  IBlobClient blobClient,
                                                  ICalculationsApiClient calculationsApiClient,
                                                  ISpecificationsApiClient specificationsApiClient,
                                                  ICalculationResultsRepository resultsRepository,
                                                  IResultsResiliencePolicies policies,
                                                  ICsvUtils csvUtils,
                                                  IProviderResultsToCsvRowsTransformation resultsToCsvRowsTransformation,
                                                  IFileSystemAccess fileSystemAccess,
                                                  IFileSystemCacheSettings fileSystemCacheSettings,
                                                  IJobManagement jobManagement) : base(jobManagement, logger)
        {
            Guard.ArgumentNotNull(logger, nameof(logger));
            Guard.ArgumentNotNull(blobClient, nameof(blobClient));
            Guard.ArgumentNotNull(specificationsApiClient, nameof(specificationsApiClient));
            Guard.ArgumentNotNull(calculationsApiClient, nameof(calculationsApiClient));
            Guard.ArgumentNotNull(resultsRepository, nameof(resultsRepository));
            Guard.ArgumentNotNull(resultsToCsvRowsTransformation, nameof(resultsToCsvRowsTransformation));
            Guard.ArgumentNotNull(fileSystemAccess, nameof(fileSystemAccess));
            Guard.ArgumentNotNull(policies?.BlobClient, nameof(policies.BlobClient));
            Guard.ArgumentNotNull(policies?.CalculationsApiClient, nameof(policies.CalculationsApiClient));
            Guard.ArgumentNotNull(policies?.SpecificationsApiClient, nameof(policies.SpecificationsApiClient));
            Guard.ArgumentNotNull(policies?.ResultsRepository, nameof(policies.ResultsRepository));
            Guard.ArgumentNotNull(fileSystemCacheSettings, nameof(fileSystemCacheSettings));
            Guard.ArgumentNotNull(jobManagement, nameof(jobManagement));

            _logger                         = logger;
            _blobClient                     = blobClient;
            _calculationsApiClient          = calculationsApiClient;
            _specificationsApiClient        = specificationsApiClient;
            _resultsRepository              = resultsRepository;
            _blobClientPolicy               = policies.BlobClient;
            _calculationsApiClientPolicy    = policies.CalculationsApiClient;
            _specificationsApiClientPolicy  = policies.SpecificationsApiClient;
            _resultsRepositoryPolicy        = policies.ResultsRepository;
            _csvUtils                       = csvUtils;
            _resultsToCsvRowsTransformation = resultsToCsvRowsTransformation;
            _fileSystemAccess               = fileSystemAccess;
            _fileSystemCacheSettings        = fileSystemCacheSettings;
            _jobManagement                  = jobManagement;
        }
コード例 #15
0
        public SpecificationsWithProviderResultsService(ICalculationResultsRepository results,
                                                        IPoliciesApiClient policies,
                                                        IJobManagement jobs,
                                                        IProducerConsumerFactory producerConsumerFactory,
                                                        IResultsResiliencePolicies resiliencePolicies,
                                                        ILogger logger) : base(jobs, logger)
        {
            Guard.ArgumentNotNull(results, nameof(results));
            Guard.ArgumentNotNull(policies, nameof(policies));
            Guard.ArgumentNotNull(resiliencePolicies?.CalculationProviderResultsSearchRepository, nameof(resiliencePolicies.CalculationProviderResultsSearchRepository));
            Guard.ArgumentNotNull(resiliencePolicies?.JobsApiClient, nameof(resiliencePolicies.JobsApiClient));
            Guard.ArgumentNotNull(resiliencePolicies?.PoliciesApiClient, nameof(resiliencePolicies.PoliciesApiClient));
            Guard.ArgumentNotNull(logger, nameof(logger));

            _results = results;
            _jobs    = jobs;
            _producerConsumerFactory = producerConsumerFactory;
            _resultsPolicy           = resiliencePolicies.CalculationProviderResultsSearchRepository;
            _jobsPolicy     = resiliencePolicies.JobsApiClient;
            _policiesPolicy = resiliencePolicies.PoliciesApiClient;
            _logger         = logger;
            _policies       = policies;
        }