예제 #1
0
        public async Task <ConfirmationViewModel> Handle(ConfirmationQuery request, CancellationToken cancellationToken)
        {
            if (!_flow.State.GotProviderDetails)
            {
                throw new InvalidStateException();
            }

            var providerId = _providerContextProvider.GetProviderId();

            var provider = await _cosmosDbQueryDispatcher.ExecuteQuery(
                new GetProviderById()
            {
                ProviderId = providerId
            });

            return(new ConfirmationViewModel()
            {
                ProviderId = providerId,
                ProviderName = provider.ProviderName,
                CourseDirectoryStatus = provider.ProviderStatus,
                MarketingInformation = _flow.State.ProviderMarketingInformation,
                ProviderType = provider.ProviderType,
                TradingName = provider.Alias,
                Ukprn = provider.Ukprn
            });
        }
 Guid IRequireUserCanSubmitQASubmission <ConfirmationQuery> .GetProviderId(ConfirmationQuery request) => request.ProviderId;