public MediatorResponse <ApprenticeshipApplicationViewModel> PromoteToInProgress(ApprenticeshipApplicationViewModel apprenticeshipApplicationViewModel) { var validationResult = _apprenticeshipApplicationViewModelServerValidator.Validate(apprenticeshipApplicationViewModel); if (!validationResult.IsValid) { return(GetMediatorResponse(ApprenticeshipApplicationMediatorCodes.PromoteToInProgress.FailedValidation, apprenticeshipApplicationViewModel, validationResult)); } try { _applicationProvider.UpdateApprenticeshipApplicationViewModelNotes(apprenticeshipApplicationViewModel.ApplicationSelection.ApplicationId, apprenticeshipApplicationViewModel.Notes, false); _applicationProvider.SetStateInProgress(apprenticeshipApplicationViewModel.ApplicationSelection); return(GetMediatorResponse(ApprenticeshipApplicationMediatorCodes.PromoteToInProgress.Ok, apprenticeshipApplicationViewModel)); } catch (Exception) { var viewModel = GetFailedUpdateApprenticeshipApplicationViewModel(apprenticeshipApplicationViewModel.ApplicationSelection); return(GetMediatorResponse(ApprenticeshipApplicationMediatorCodes.PromoteToInProgress.Error, viewModel, ApplicationViewModelMessages.UpdateNotesFailed, UserMessageLevel.Error)); } }