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); }
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)); }
public async Task <IActionResult> GetConfirmation(ConfirmationQuery query) => await _mediator.SendAndMapResponse(query, vm => View("ApprenticeshipAssessmentConfirmation", vm));
Guid IRestrictQAStatus <ConfirmationQuery> .GetProviderId(ConfirmationQuery request) => _journeyInstance.State.ProviderId;