Ejemplo n.º 1
0
        public async Task <bool> HasAgreementAsync(long ukprn)
        {
            var editVacancyInfo = await _client.GetProviderEditVacancyInfoAsync(ukprn);

            if (editVacancyInfo == null)
            {
                return(false);
            }

            if (editVacancyInfo.HasProviderAgreement)
            {
                return(true);
            }

            //Agreement may have been signed since the projection was created. Check PAS.
            var hasAgreement = await _pasAccountClient.HasAgreementAsync(ukprn);

            if (hasAgreement)
            {
                await _client.SetupProviderAsync(ukprn);
            }

            return(hasAgreement);
        }