Exemplo n.º 1
0
 public Standard MapToStandard(StandardSearchResultsItem document)
 {
     return(new Standard
     {
         StandardId = document.StandardId.ToString(),
         Title = document.Title,
         StandardPdf = document.StandardPdf,
         AssessmentPlanPdf = document.AssessmentPlanPdf,
         Level = document.Level,
         IsPublished = document.Published,
         JobRoles = document.JobRoles,
         Keywords = document.Keywords,
         Duration = document.Duration,
         FundingPeriods = document.FundingPeriods,
         CurrentFundingBand = _fundingCapCalculator.CalculateCurrentFundingBand(document),
         TypicalLength = new TypicalLength {
             From = document.Duration, To = document.Duration, Unit = "m"
         },
         IntroductoryText = document.IntroductoryText,
         EntryRequirements = document.EntryRequirements,
         WhatApprenticesWillLearn = document.WhatApprenticesWillLearn,
         Qualifications = document.Qualifications,
         ProfessionalRegistration = document.ProfessionalRegistration,
         OverviewOfRole = document.OverviewOfRole,
         Ssa1 = document.SectorSubjectAreaTier1,
         Ssa2 = document.SectorSubjectAreaTier2,
         StandardSectorCode = document.StandardSectorCode,
         EffectiveFrom = document.EffectiveFrom,
         EffectiveTo = document.EffectiveTo,
         IsActiveStandard = _activeApprenticeshipChecker.CheckActiveStandard(document.StandardId.ToString(), document.EffectiveFrom, document.EffectiveTo),
         LastDateForNewStarts = document.LastDateForNewStarts,
         RegulatedStandard = document.RegulatedStandard
     });
 }
Exemplo n.º 2
0
        private IEnumerable <ApprenticeshipTraining> GetActiveStandardsForUkprn(long ukprn)
        {
            var standards = GetStandardsByProviderUkprn(ukprn);

            return(standards
                   .Where(x => _activeApprenticeshipChecker.CheckActiveStandard(x.StandardId.ToString(), x.EffectiveFrom, x.EffectiveTo))
                   .Select(standard => new ApprenticeshipTraining
            {
                Name = standard.Title,
                Level = standard.Level,
                Type = ApprenticeshipTrainingType.Standard.ToString(),
                TrainingType = ApprenticeshipTrainingType.Standard,
                Identifier = standard.StandardId.ToString()
            })
                   .ToList());
        }
Exemplo n.º 3
0
 public int CalculateCurrentFundingBand(StandardSearchResultsItem standard)
 {
     return(_activeApprenticeshipChecker.CheckActiveStandard(standard.StandardId.ToString(), standard.EffectiveFrom, standard.EffectiveTo) ? GetFundingCapFromPeriods(standard.FundingPeriods) : 0);
 }