public static List <MyApprenticeshipApplicationViewModel> GetApprenticeships(int count,
                                                                                     ApplicationStatuses applicationStatus = ApplicationStatuses.Draft, string unsuccessfulReason = null)
        {
            var apprenticeships = new List <MyApprenticeshipApplicationViewModel>();

            for (var i = 0; i < count; i++)
            {
                var myApprenticeshipApplicationViewModel = new MyApprenticeshipApplicationViewModel
                {
                    ApplicationStatus = applicationStatus
                };

                if (applicationStatus == ApplicationStatuses.Submitted)
                {
                    myApprenticeshipApplicationViewModel.DateApplied = new DateTime(2015, 01, 01);
                }

                if (unsuccessfulReason != null)
                {
                    myApprenticeshipApplicationViewModel.UnsuccessfulReason   = unsuccessfulReason;
                    myApprenticeshipApplicationViewModel.UnsuccessfulDateTime = DateTime.Now;
                }

                apprenticeships.Add(myApprenticeshipApplicationViewModel);
            }

            return(apprenticeships);
        }
        public MediatorResponse <MyApprenticeshipApplicationViewModel> CandidateApplicationFeedback(Guid candidateId, int vacancyId)
        {
            ApprenticeshipApplicationViewModel   model = _apprenticeshipApplicationProvider.GetApplicationViewModel(candidateId, vacancyId);
            MyApplicationsViewModel              myApplicationsViewModel   = _apprenticeshipApplicationProvider.GetMyApplications(candidateId);
            MyApprenticeshipApplicationViewModel apprenticeshipApplication = myApplicationsViewModel.AllApprenticeshipApplications.FirstOrDefault(
                vm => vm.VacancyId == vacancyId);

            if (model.ViewModelStatus == ApplicationViewModelStatus.ApplicationNotFound)
            {
                return(GetMediatorResponse(ApprenticeshipApplicationMediatorCodes.CandidateApplicationFeedback.ApplicationNotFound, apprenticeshipApplication, ApplicationPageMessages.ViewApplicationFailed, UserMessageLevel.Warning));
            }

            if (model.HasError())
            {
                return(GetMediatorResponse <MyApprenticeshipApplicationViewModel>(ApprenticeshipApplicationMediatorCodes.CandidateApplicationFeedback.Error, null, ApplicationPageMessages.ViewApplicationFailed, UserMessageLevel.Warning));
            }

            apprenticeshipApplication.ProviderName = model.ProviderName;
            apprenticeshipApplication.Contact      = model.Contact;

            return(GetMediatorResponse(ApprenticeshipApplicationMediatorCodes.CandidateApplicationFeedback.Ok, apprenticeshipApplication));
        }