public async Task <HttpResponseMessage> ChangeCourseRunStatusesForUKPRNSelection(int UKPRN, RecordStatus CurrentStatus, RecordStatus StatusToBeChangedTo)
        {
            Throw.IfNull <int>(UKPRN, nameof(UKPRN));
            Throw.IfLessThan(0, UKPRN, nameof(UKPRN));

            var allCourses         = GetCoursesByUKPRN(UKPRN).Result;
            var coursesToBeChanged = allCourses.Where(x => x.CourseRuns.Any(cr => cr.RecordStatus == CurrentStatus)).ToList();
            int currentstatus      = (int)CurrentStatus;

            int statusTobeChangeTo = (int)StatusToBeChangedTo;

            try
            {
                using (var client = _cosmosDbHelper.GetClient())
                {
                    var spResults = await _cosmosDbHelper.UpdateRecordStatuses(client, _settings.CoursesCollectionId, "UpdateRecordStatuses", UKPRN, currentstatus, statusTobeChangeTo, UKPRN);

                    return(new HttpResponseMessage(HttpStatusCode.OK));
                }
            }
            catch (Exception)
            {
                return(new HttpResponseMessage(HttpStatusCode.ExpectationFailed));
            }
        }
        public Task ChangeApprenticeshipStatusForUKPRNSelection(int UKPRN, RecordStatus CurrentStatus, RecordStatus StatusToBeChangedTo)
        {
            Throw.IfNull <int>(UKPRN, nameof(UKPRN));
            Throw.IfLessThan(0, UKPRN, nameof(UKPRN));

            int currentstatus = (int)CurrentStatus;

            int statusTobeChangeTo = (int)StatusToBeChangedTo;

            var client = _cosmosDbHelper.GetClient();

            return(_cosmosDbHelper.UpdateRecordStatuses(client, _settings.ApprenticeshipCollectionId, "UpdateRecordStatuses", UKPRN, currentstatus, statusTobeChangeTo, UKPRN));
        }