Esempio n. 1
0
        public async Task <ConfirmationViewModel> Handle(ConfirmationQuery request, CancellationToken cancellationToken)
        {
            if (!_journeyInstance.State.GotAssessmentOutcome)
            {
                throw new InvalidStateException();
            }

            var apprenticeshipId = _journeyInstance.State.ApprenticeshipId;

            var submission = await GetSubmission();

            var submissionApprenticeship = submission.Apprenticeships.Single(a => a.ApprenticeshipId == apprenticeshipId);

            var vm = new ConfirmationViewModel()
            {
                ApprenticeshipId        = _journeyInstance.State.ApprenticeshipId,
                ProviderId              = _journeyInstance.State.ProviderId,
                ApprenticeshipTitle     = submissionApprenticeship.ApprenticeshipTitle,
                ComplianceComments      = _journeyInstance.State.ComplianceComments,
                ComplianceFailedReasons = _journeyInstance.State.ComplianceFailedReasons.Value,
                CompliancePassed        = _journeyInstance.State.CompliancePassed.Value,
                Passed             = _journeyInstance.State.IsApprenticeshipAssessmentPassed(),
                StyleComments      = _journeyInstance.State.StyleComments,
                StyleFailedReasons = _journeyInstance.State.StyleFailedReasons.Value,
                StylePassed        = _journeyInstance.State.StylePassed.Value
            };

            return(vm);
        }
Esempio n. 2
0
        public Task <ConfirmationViewModel> Handle(ConfirmationQuery request, CancellationToken cancellationToken)
        {
            if (!_journeyInstance.State.GotAssessmentOutcome)
            {
                throw new InvalidStateException();
            }

            var vm = new ConfirmationViewModel()
            {
                ProviderId              = _journeyInstance.State.ProviderId,
                ComplianceComments      = _journeyInstance.State.ComplianceComments,
                ComplianceFailedReasons = _journeyInstance.State.ComplianceFailedReasons.Value,
                CompliancePassed        = _journeyInstance.State.CompliancePassed.Value,
                Passed             = _journeyInstance.State.IsProviderAssessmentPassed(),
                StyleComments      = _journeyInstance.State.StyleComments,
                StyleFailedReasons = _journeyInstance.State.StyleFailedReasons.Value,
                StylePassed        = _journeyInstance.State.StylePassed.Value
            };

            return(Task.FromResult(vm));
        }
Esempio n. 3
0
 public async Task <IActionResult> GetConfirmation(ConfirmationQuery query) =>
 await _mediator.SendAndMapResponse(query, vm => View("ApprenticeshipAssessmentConfirmation", vm));
Esempio n. 4
0
 Guid IRestrictQAStatus <ConfirmationQuery> .GetProviderId(ConfirmationQuery request) => _journeyInstance.State.ProviderId;