示例#1
0
        public async Task<EmployerContactDetailsViewModel> GetEmployerContactDetailsViewModelAsync(VacancyRouteModel vrm)
        {
            var vacancy = await Utility.GetAuthorisedVacancyForEditAsync(_client, _vacancyClient, vrm, RouteNames.EmployerContactDetails_Get);

            var vm = new EmployerContactDetailsViewModel
            {
                Title = vacancy.Title,
                EmployerContactName = vacancy.EmployerContact?.Name,
                EmployerContactEmail = vacancy.EmployerContact?.Email,
                EmployerContactPhone = vacancy.EmployerContact?.Phone,
                EmployerTitle = await GetEmployerTitleAsync(vacancy)
            };

            if (vacancy.Status == VacancyStatus.Referred)
            {
                vm.Review = await _reviewSummaryService.GetReviewSummaryViewModelAsync(vacancy.VacancyReference.Value,
                    ReviewFieldMappingLookups.GetEmployerContactDetailsFieldIndicators());
            }

            return vm;
        }