public async Task <IActionResult> ProviderContactDetails(ProviderContactDetailsEditModel m)
        {
            var response = await _orchestrator.PostProviderContactDetailsEditModelAsync(m, User.ToVacancyUser());

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }

            if (!ModelState.IsValid)
            {
                var vm = await _orchestrator.GetProviderContactDetailsViewModelAsync(m);

                return(View(vm));
            }

            return(RedirectToRoute(RouteNames.Vacancy_Preview_Get));
        }
        public async Task WhenProviderContactNameIsUpdated__ShouldCallUpdateDraftVacancy(string providerContactName, string providerContactEmail, string providerContactPhone)
        {
            _fixture
            .WithProviderContactName("has a value")
            .WithProviderContactEmail("has a value")
            .WithProviderContactPhone("has a value")
            .Setup();

            var providerContactDetailsEditModel = new ProviderContactDetailsEditModel
            {
                Ukprn                = _fixture.Vacancy.TrainingProvider.Ukprn.Value,
                VacancyId            = _fixture.Vacancy.Id,
                ProviderContactName  = providerContactName,
                ProviderContactEmail = providerContactEmail,
                ProviderContactPhone = providerContactPhone
            };

            await _fixture.PostProviderContactDetailsEditModelAsync(providerContactDetailsEditModel);

            _fixture.VerifyUpdateDraftVacancyAsyncIsCalled();
        }
        public async Task WhenProviderContactNameIsUpdated_ShouldFlagProviderContactFieldIndicator(string providerContactName, string providerContactEmail, string providerContactPhone)
        {
            _fixture
            .WithProviderContactName("has a value")
            .WithProviderContactEmail("has a value")
            .WithProviderContactPhone("has a value")
            .Setup();

            var providerContactDetailsEditModel = new ProviderContactDetailsEditModel
            {
                Ukprn                = _fixture.Vacancy.TrainingProvider.Ukprn.Value,
                VacancyId            = _fixture.Vacancy.Id,
                ProviderContactName  = providerContactName,
                ProviderContactEmail = providerContactEmail,
                ProviderContactPhone = providerContactPhone
            };

            await _fixture.PostProviderContactDetailsEditModelAsync(providerContactDetailsEditModel);

            _fixture.VerifyProviderReviewFieldIndicators(FieldIdentifiers.ProviderContact, true);
        }
 public async Task PostProviderContactDetailsEditModelAsync(ProviderContactDetailsEditModel model)
 {
     await Sut.PostProviderContactDetailsEditModelAsync(model, User);
 }