Example #1
0
 public RestrictProviderTypeBehavior(
     IRestrictProviderType <TRequest> descriptor,
     IProviderInfoCache providerInfoCache)
 {
     _descriptor        = descriptor;
     _providerInfoCache = providerInfoCache;
 }
Example #2
0
 public QANotificationsViewComponent(
     IProviderContextProvider providerContextProvider,
     ISqlQueryDispatcher sqlQueryDispatcher,
     IProviderInfoCache providerInfoCache)
 {
     _providerContextProvider = providerContextProvider;
     _sqlQueryDispatcher      = sqlQueryDispatcher;
     _providerInfoCache       = providerInfoCache;
 }
 public Handler(
     IProviderInfoCache providerInfoCache,
     ICosmosDbQueryDispatcher cosmosDbQueryDispatcher,
     JourneyInstanceProvider journeyInstanceProvider)
 {
     _providerInfoCache       = providerInfoCache;
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher;
     _journeyInstanceProvider = journeyInstanceProvider;
 }
 public Handler(
     JourneyInstance <EditVenueJourneyModel> journeyInstance,
     IProviderOwnershipCache providerOwnershipCache,
     IProviderInfoCache providerInfoCache,
     ICosmosDbQueryDispatcher cosmosDbQueryDispatcher)
 {
     _journeyInstance         = journeyInstance;
     _providerOwnershipCache  = providerOwnershipCache;
     _providerInfoCache       = providerInfoCache;
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher;
 }
Example #5
0
 public RequireUserCanSubmitQASubmissionBehavior(
     IRequireUserCanSubmitQASubmission <TRequest> descriptor,
     ICurrentUserProvider currentUserProvider,
     ISqlQueryDispatcher sqlQueryDispatcher,
     IProviderInfoCache providerInfoCache)
 {
     _descriptor          = descriptor;
     _currentUserProvider = currentUserProvider;
     _sqlQueryDispatcher  = sqlQueryDispatcher;
     _providerInfoCache   = providerInfoCache;
 }
Example #6
0
 public Handler(
     IProviderInfoCache providerInfoCache,
     IProviderOwnershipCache providerOwnershipCache,
     ICosmosDbQueryDispatcher cosmosDbQueryDispatcher,
     FormFlowInstance <FlowModel> formFlowInstance)
 {
     _providerInfoCache       = providerInfoCache;
     _providerOwnershipCache  = providerOwnershipCache;
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher;
     _formFlowInstance        = formFlowInstance;
 }
Example #7
0
 public Handler(
     FormFlowInstance <EditVenueFlowModel> formFlowInstance,
     IProviderOwnershipCache providerOwnershipCache,
     IProviderInfoCache providerInfoCache,
     ICosmosDbQueryDispatcher cosmosDbQueryDispatcher)
 {
     _formFlowInstance        = formFlowInstance;
     _providerOwnershipCache  = providerOwnershipCache;
     _providerInfoCache       = providerInfoCache;
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher;
 }
Example #8
0
        public async Task <IActionResult> SearchProvider(
            int UKPRN,
            [FromServices] IProviderInfoCache providerInfoCache,
            [FromServices] IProviderContextProvider providerContextProvider)
        {
            var providerInfo = await providerInfoCache.GetProviderInfoForUkprn(UKPRN);

            providerContextProvider.SetProviderContext(new ProviderContext(providerInfo));

            Session.SetInt32("UKPRN", UKPRN);
            return(RedirectToAction("Dashboard", "Provider"));
        }
        public async Task <IActionResult> Confirmed(
            [FromServices] IProviderContextProvider providerContextProvider,
            [FromServices] IProviderInfoCache providerInfoCache,
            ConfirmedQuery request)
        {
            var vm = await _mediator.Send(request);

            var providerInfo = await providerInfoCache.GetProviderInfo(vm.ProviderId);

            providerContextProvider.SetProviderContext(new ProviderContext(providerInfo));

            return(View(vm));
        }
Example #10
0
 public RequireUserCanAccessCourseBehavior(
     IRequireUserCanAccessCourse <TRequest> descriptor,
     ICurrentUserProvider currentUserProvider,
     IProviderOwnershipCache providerOwnershipCache,
     IProviderContextProvider providerContextProvider,
     IProviderInfoCache providerInfoCache)
 {
     _descriptor              = descriptor;
     _currentUserProvider     = currentUserProvider;
     _providerOwnershipCache  = providerOwnershipCache;
     _providerContextProvider = providerContextProvider;
     _providerInfoCache       = providerInfoCache;
 }
 public Handler(
     ICosmosDbQueryDispatcher cosmosDbQueryDispatcher,
     ISqlQueryDispatcher sqlQueryDispatcher,
     IProviderInfoCache providerInfoCache,
     IClock clock,
     ICurrentUserProvider currentUserProvider)
 {
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher;
     _sqlQueryDispatcher      = sqlQueryDispatcher;
     _providerInfoCache       = providerInfoCache;
     _clock = clock;
     _currentUserProvider = currentUserProvider;
 }
Example #12
0
 public Handler(
     MptxInstanceContext <FlowModel> flow,
     ISqlQueryDispatcher sqlQueryDispatcher,
     ICosmosDbQueryDispatcher cosmosDbQueryDispatcher,
     ICurrentUserProvider currentUserProvider,
     IClock clock,
     IProviderInfoCache providerInfoCache)
 {
     _flow = flow;
     _sqlQueryDispatcher      = sqlQueryDispatcher;
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher;
     _currentUserProvider     = currentUserProvider;
     _clock             = clock;
     _providerInfoCache = providerInfoCache;
 }
 public Handler(
     IProviderInfoCache providerInfoCache,
     IProviderOwnershipCache providerOwnershipCache,
     ICosmosDbQueryDispatcher cosmosDbQueryDispatcher,
     JourneyInstance <JourneyModel> journeyInstance,
     IClock clock,
     ICurrentUserProvider currentUserProvider)
 {
     _providerInfoCache       = providerInfoCache ?? throw new ArgumentNullException(nameof(providerInfoCache));
     _providerOwnershipCache  = providerOwnershipCache ?? throw new ArgumentNullException(nameof(providerOwnershipCache));
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher ?? throw new ArgumentNullException(nameof(cosmosDbQueryDispatcher));
     _journeyInstance         = journeyInstance ?? throw new ArgumentNullException(nameof(journeyInstance));
     _clock = clock ?? throw new ArgumentNullException(nameof(clock));
     _currentUserProvider = currentUserProvider ?? throw new ArgumentNullException(nameof(currentUserProvider));
 }
Example #14
0
        public static async Task <ProviderInfo> GetProviderInfoForUkprn(this IProviderInfoCache providerInfoCache, int ukprn)
        {
            if (providerInfoCache == null)
            {
                throw new ArgumentNullException(nameof(providerInfoCache));
            }

            var providerId = await providerInfoCache.GetProviderIdForUkprn(ukprn);

            if (providerId == null)
            {
                return(null);
            }

            return(await providerInfoCache.GetProviderInfo(providerId.Value));
        }
        public async Task <IActionResult> AddOrEditProviderType(
            ProviderTypeAddOrEditViewModel model,
            [FromServices] IProviderInfoCache providerInfoCache,
            [FromServices] ISqlQueryDispatcher sqlQueryDispatcher)
        {
            int?UKPRN = Session.GetInt32("UKPRN");

            var providerSearchResult = await _providerService.GetProviderByPRNAsync(UKPRN.ToString());

            Provider provider;

            if (providerSearchResult.IsSuccess)
            {
                provider = providerSearchResult.Value.FirstOrDefault();

                var oldProviderType = provider.ProviderType;
                if (oldProviderType == ProviderType.FE && model.ProviderType.HasFlag(ProviderType.Apprenticeship))
                {
                    await sqlQueryDispatcher.ExecuteQuery(
                        new EnsureApprenticeshipQAStatusSetForProvider()
                    {
                        ProviderId = provider.id
                    });
                }

                provider.ProviderType = model.ProviderType;

                var result = await _providerService.UpdateProviderDetails(provider);

                if (!result.IsSuccess)
                {
                    throw new Exception(result.Error);
                }

                await providerInfoCache.Remove(provider.id);
            }
            else
            {
                throw new Exception(providerSearchResult.Error);
            }

            return(RedirectToAction("ProviderDetails", "Providers", new { providerId = provider.id }));
        }
 public ApprenticeshipsController(
     ICourseService courseService,
     ISqlQueryDispatcher sqlQueryDispatcher,
     IOptions <ApprenticeshipSettings> apprenticeshipSettings,
     IStandardsCache standardsAndFrameworksCache,
     IProviderInfoCache providerInfoCache,
     IProviderContextProvider providerContextProvider,
     IFeatureFlagProvider featureFlagProvider,
     ICurrentUserProvider currentUserProvider,
     IClock clock)
 {
     _courseService               = courseService ?? throw new ArgumentNullException(nameof(courseService));
     _sqlQueryDispatcher          = sqlQueryDispatcher;
     _apprenticeshipSettings      = apprenticeshipSettings ?? throw new ArgumentNullException(nameof(apprenticeshipSettings));
     _standardsAndFrameworksCache = standardsAndFrameworksCache ?? throw new ArgumentNullException(nameof(standardsAndFrameworksCache));
     _providerInfoCache           = providerInfoCache;
     _providerContextProvider     = providerContextProvider;
     _featureFlagProvider         = featureFlagProvider;
     _currentUserProvider         = currentUserProvider;
     _clock = clock;
 }
Example #17
0
 public Handler(ICosmosDbQueryDispatcher cosmosDbQueryDispatcher, IProviderInfoCache providerInfoCache)
 {
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher;
     _providerInfoCache       = providerInfoCache;
 }
 public TestUserInfo(IServiceScopeFactory serviceScopeFactory, IProviderInfoCache providerInfoCache)
 {
     _serviceScopeFactory = serviceScopeFactory;
     _providerInfoCache   = providerInfoCache;
 }
 public QueryHandler(ICosmosDbQueryDispatcher cosmosDbQueryDispatcher, IProviderInfoCache providerInfoCache)
 {
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher ?? throw new ArgumentNullException(nameof(cosmosDbQueryDispatcher));
     _providerInfoCache       = providerInfoCache ?? throw new ArgumentNullException(nameof(providerInfoCache));
 }