Exemple #1
0
 public bool Excluded(int ukprn, int?progType, IEnumerable <ILearningDeliveryFAM> learningDeliveryFams)
 {
     return(_dd07.IsApprenticeship(progType) ||
            _learningDeliveryFamQueryService.HasLearningDeliveryFAMType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.RES) ||
            _learningDeliveryFamQueryService.HasAnyLearningDeliveryFAMCodesForType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.LDM, _learningDeliveryFamCodes) ||
            _organisationDataService.LegalOrgTypeMatchForUkprn(ukprn, LegalOrgTypeConstants.USDC));
 }
 public bool Excluded(int?progType, IEnumerable <ILearningDeliveryFAM> learningDeliveryFams, string learnAimRef)
 {
     return(_derivedData07.IsApprenticeship(progType) ||
            _learningDeliveryFamQueryService.HasLearningDeliveryFAMType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.RES) ||
            _learningDeliveryFamQueryService.HasAnyLearningDeliveryFAMCodesForType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.LDM, _learningDeliveryFamCodes) ||
            _larsDataService.HasAnyLearningDeliveryForLearnAimRefAndTypes(learnAimRef, _learnAimRefTypes));
 }
 public bool ConditionMet(int fundModel, IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs, DateTime?dateOfBirth)
 {
     return
         (!dateOfBirth.HasValue &&
          _fundModels.Contains(fundModel) &&
          !_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.ADL));
 }
Exemple #4
0
 public bool ConditionMet(DateTime?origLearnStartDate, int fundModel, IReadOnlyCollection <ILearningDeliveryFAM> learningDeliveryFams, string learnAimRef)
 {
     return(OrigLearnStartDateConditionMet(origLearnStartDate) &&
            FundModelConditionMet(fundModel) &&
            _learningDeliveryFamQueryService.HasLearningDeliveryFAMType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.ADL) &&
            LARSConditionMet(origLearnStartDate.Value, learnAimRef));
 }
Exemple #5
0
        public void Validate(ILearner learner)
        {
            if (learner.LearningDeliveries == null)
            {
                return;
            }

            ILearningDelivery ldToCheck = GetLearningDeliveryWithLatestFAMDateFrom(learner.LearningDeliveries);

            if (ldToCheck == null)
            {
                return;
            }

            if (ldToCheck.LearnActEndDateNullable.HasValue &&
                _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(ldToCheck.LearningDeliveryFAMs, LearningDeliveryFAMTypeConstants.ACT))
            {
                foreach (var ldfam in ldToCheck.LearningDeliveryFAMs)
                {
                    if (ldfam.LearnDelFAMType == LearningDeliveryFAMTypeConstants.ACT &&
                        (!ldfam.LearnDelFAMDateToNullable.HasValue ||
                         ldfam.LearnDelFAMDateToNullable.Value != ldToCheck.LearnActEndDateNullable))
                    {
                        HandleValidationError(
                            learner.LearnRefNumber,
                            ldToCheck.AimSeqNumber,
                            BuildErrorMessageParameters(ldToCheck.LearnActEndDateNullable, LearningDeliveryFAMTypeConstants.ACT, ldfam.LearnDelFAMDateToNullable));
                    }
                }
            }
        }
Exemple #6
0
 public bool IsExcluded(int?progType, string lsdPostcode, IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs, bool longTermResUkprn)
 {
     return(progType.HasValue ||
            lsdPostcode.CaseInsensitiveEquals(ValidationConstants.TemporaryPostCode) ||
            longTermResUkprn ||
            _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.LDM, LearningDeliveryFAMCodeConstants.LDM_OLASS) ||
            _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.DAM, LearningDeliveryFAMCodeConstants.DAM_Code_001) ||
            _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.RES));
 }
 public bool ConditionMet(ILearningDelivery learningDelivery)
 {
     return(LearnStartDateConditionMet(learningDelivery.LearnStartDate) &&
            ProgTypeConditionMet(learningDelivery.ProgTypeNullable) &&
            AimTypeConditionMet(learningDelivery.AimType) &&
            StdCodeExists(learningDelivery.StdCodeNullable) &&
            !_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDelivery.LearningDeliveryFAMs, LearningDeliveryFAMTypeConstants.RES) &&
            LARSConditionMet(learningDelivery.StdCodeNullable.Value, learningDelivery.LearnStartDate));
 }
        public bool ConditionMet(DateTime learnStartDate, IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs)
        {
            if (learningDeliveryFAMs != null)
            {
                return(_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, _famTypeACT) &&
                       !_learningDeliveryFAMQueryService.HasLearningDeliveryFAMTypeForDate(learningDeliveryFAMs, _famTypeACT, learnStartDate));
            }

            return(false);
        }
Exemple #9
0
 public bool IsExcluded(ILearningDelivery theDelivery)
 {
     return(_learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(
                theDelivery.LearningDeliveryFAMs,
                LearningDeliveryFAMTypeConstants.LDM,
                LearningDeliveryFAMCodeConstants.LDM_ProcuredAdultEducationBudget) ||
            _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(
                theDelivery.LearningDeliveryFAMs,
                LearningDeliveryFAMTypeConstants.RES));
 }
        /// <summary>
        /// Validates the specified object.
        /// </summary>
        /// <param name="learner">The object to validate.</param>
        public void Validate(ILearner learner)
        {
            if (learner?.LearningDeliveries == null ||
                !learner.DateOfBirthNullable.HasValue)
            {
                return;
            }

            foreach (var learningDelivery in learner.LearningDeliveries)
            {
                if (learningDelivery.LearnStartDate > _ruleEndDate)
                {
                    continue;
                }

                var age = _dateTimeQueryService.AgeAtGivenDate(
                    learner.DateOfBirthNullable.Value,
                    learningDelivery.LearnStartDate);

                if (age < MinAge)
                {
                    continue;
                }

                if (_fundModels.All(fm => fm != learningDelivery.FundModel) ||
                    (learningDelivery.ProgTypeNullable ?? -1) != ProgrammeType ||
                    learningDelivery.AimType != AimType)
                {
                    continue;
                }

                if (_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(
                        learningDelivery.LearningDeliveryFAMs,
                        LearningDeliveryFAMTypeConstants.RES))
                {
                    continue;
                }

                if (!learningDelivery.OutcomeNullable.HasValue ||
                    learningDelivery.OutcomeNullable.Value != OutcomeConstants.Achieved)
                {
                    continue;
                }

                if (!learningDelivery.LearnActEndDateNullable.HasValue ||
                    _dateTimeQueryService.YearsBetween(
                        learningDelivery.LearnStartDate,
                        learningDelivery.LearnActEndDateNullable.Value) >= 1)
                {
                    continue;
                }

                RaiseValidationMessage(learner, learningDelivery);
            }
        }
Exemple #11
0
        public bool IsLearningDeliveryExcluded(ILearner learner, ILearningDelivery learningDelivery)
        {
            if (learningDelivery.ProgTypeNullable.HasValue &&
                learningDelivery.ProgTypeNullable.Value == TypeOfLearningProgramme.Traineeship)
            {
                return(true);
            }

            if (_dd07.IsApprenticeship(learningDelivery.ProgTypeNullable))
            {
                return(true);
            }

            if (_famQueryService.HasAnyLearningDeliveryFAMCodesForType(
                    learningDelivery.LearningDeliveryFAMs,
                    LearningDeliveryFAMTypeConstants.LDM,
                    famCodesForExclusion))
            {
                return(true);
            }

            if (_dd12.IsAdultSkillsFundedOnBenefits(learner.LearnerEmploymentStatuses, learningDelivery))
            {
                return(true);
            }

            if (_derivedDataRule21.IsAdultFundedUnemployedWithOtherStateBenefits(learningDelivery, learner))
            {
                return(true);
            }

            if (_famQueryService.HasLearningDeliveryFAMType(learningDelivery.LearningDeliveryFAMs, LearningDeliveryFAMTypeConstants.RES))
            {
                return(true);
            }

            if (_larsDataService.BasicSkillsMatchForLearnAimRefAndStartDate(
                    TypeOfLARSBasicSkill.AsEnglishAndMathsBasicSkills,
                    learningDelivery.LearnAimRef,
                    learningDelivery.LearnStartDate))
            {
                return(true);
            }

            if (_larsDataService.LearnAimRefExistsForLearningDeliveryCategoryRef(
                    learningDelivery.LearnAimRef,
                    TradeUnionAimsCategoryRef))
            {
                return(true);
            }

            return(false);
        }
Exemple #12
0
 public bool IsExcluded(ILearningDelivery delivery) =>
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.RES) ||
 _dd07.IsApprenticeship(delivery.ProgTypeNullable) ||
 delivery.ProgTypeNullable == ProgTypes.Traineeship ||
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.DAM,
     LearningDeliveryFAMCodeConstants.DAM_DevolvedLevelTwoOrThreeExclusion) ||
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.LDM,
     LearningDeliveryFAMCodeConstants.LDM_376);
Exemple #13
0
 public bool IsExcluded(ILearningDelivery delivery) =>
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.RES) ||
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.LDM,
     LearningDeliveryFAMCodeConstants.LDM_OLASS) ||
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.LDM,
     LearningDeliveryFAMCodeConstants.LDM_SteelRedundancy) ||
 _dd07.IsApprenticeship(delivery.ProgTypeNullable) ||
 IsSpecialistDesignatedCollege();
        public bool IsLearningDeliveryExcluded(ILearner learner, ILearningDelivery learningDelivery)
        {
            if (learningDelivery.ProgTypeNullable.HasValue &&
                learningDelivery.ProgTypeNullable.Value == ProgTypes.Traineeship)
            {
                return(true);
            }

            if (_dd07.IsApprenticeship(learningDelivery.ProgTypeNullable))
            {
                return(true);
            }

            if (_famQueryService.HasAnyLearningDeliveryFAMCodesForType(
                    learningDelivery.LearningDeliveryFAMs,
                    LearningDeliveryFAMTypeConstants.LDM,
                    famCodesForExclusion))
            {
                return(true);
            }

            if (_dd28.IsAdultFundedUnemployedWithBenefits(learningDelivery, learner))
            {
                return(true);
            }

            if (_dd29.IsInflexibleElementOfTrainingAimLearningDelivery(learningDelivery))
            {
                return(true);
            }

            if (_famQueryService.HasLearningDeliveryFAMType(learningDelivery.LearningDeliveryFAMs, LearningDeliveryFAMTypeConstants.RES))
            {
                return(true);
            }

            if (_larsDataService.BasicSkillsMatchForLearnAimRefAndStartDate(
                    LARSConstants.BasicSkills.EnglishAndMathsList,
                    learningDelivery.LearnAimRef,
                    learningDelivery.LearnStartDate))
            {
                return(true);
            }

            return(false);
        }
Exemple #15
0
 public bool IsExcluded(ILearningDelivery delivery) =>
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.RES) ||
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.LDM,
     LearningDeliveryFAMCodeConstants.LDM_OLASS) ||
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.LDM,
     LearningDeliveryFAMCodeConstants.LDM_SteelRedundancy) ||
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(
     delivery.LearningDeliveryFAMs,
     LearningDeliveryFAMTypeConstants.DAM,
     LearningDeliveryFAMCodeConstants.DAM_DevolvedLevelTwoOrThreeExclusion) ||
 _dd07.IsApprenticeship(delivery.ProgTypeNullable);
 public bool LearningDeliveryFAMConditionMet(IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs)
 {
     return(_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, "ADL"));
 }
 public bool LearningDeliveryFAMConditionMet(IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs)
 {
     return(!_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.RES));
 }
 public bool Excluded(int?progType, IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs)
 {
     return(progType == 25 ||
            _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, "RES"));
 }
Exemple #19
0
 public bool HasNoRestartFamType(IEnumerable <ILearningDeliveryFAM> learningDeliveryFams) =>
 !_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.RES);
 public bool LearningDeliveryFAMConditionMet(IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs)
 {
     return(!(_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, "RES") ||
              _learningDeliveryFAMQueryService.HasAnyLearningDeliveryFAMCodesForType(learningDeliveryFAMs, "LDM", _ldmCodes)));
 }
 public bool LearningDeliveryFAMsConditionMet(IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs)
 {
     return(!_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.HHS) &&
            !_learningDeliveryFAMQueryService.HasLearningDeliveryFAMCodeForType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.LDM, "034"));
 }
Exemple #22
0
 public bool ConditionMet(int fundModel, IEnumerable <ILearningDeliveryFAM> learningDeliveryFams)
 {
     return(fundModel != TypeOfFunding.NotFundedByESFA && _learningDeliveryFamQueryService.HasLearningDeliveryFAMType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.ADL));
 }
Exemple #23
0
 public bool Exclude(ILearningDelivery learningDelivery)
 {
     return(_learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDelivery.LearningDeliveryFAMs, LearningDeliveryFAMTypeConstants.ADL));
 }
Exemple #24
0
 public bool Excluded(int?progType, IEnumerable <ILearningDeliveryFAM> learningDeliveryFams)
 {
     return((progType.HasValue && progType == ProgTypes.ApprenticeshipStandard) ||
            _learningDeliveryFamQueryService.HasLearningDeliveryFAMType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.RES));
 }
 public virtual bool LearningDeliveryFAMConditionMet(IEnumerable <ILearningDeliveryFAM> learningDeliveryFams)
 {
     return(!_learningDeliveryFamQueryService.HasLearningDeliveryFAMType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.RES) &&
            !_learningDeliveryFamQueryService.HasAnyLearningDeliveryFAMCodesForType(learningDeliveryFams, LearningDeliveryFAMTypeConstants.LDM, _ldmLearningDeliveryFamCodes));
 }
Exemple #26
0
 public bool IsRestart(ILearningDelivery theDelivery) =>
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(theDelivery.LearningDeliveryFAMs, LearningDeliveryFAMTypeConstants.RES);
 public bool LearningDeliveryFAMsConditionMet(IReadOnlyCollection <ILearningDeliveryFAM> learningDeliveryFAMs)
 => _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.ACT);
Exemple #28
0
 public bool FamTypeConditionMet(IEnumerable<ILearningDeliveryFAM> learningDeliveryFams)
 {
     return _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(learningDeliveryFams, "ADL");
 }
Exemple #29
0
 public virtual bool RestartConditionMet(IEnumerable <ILearningDeliveryFAM> learningDeliveryFAMs)
 {
     return(!_learningDeliveryFamQueryService.HasLearningDeliveryFAMType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.RES));
 }
 public bool IsLearningSupportFunding(ILearningDelivery theDelivery) =>
 _learningDeliveryFAMQueryService.HasLearningDeliveryFAMType(theDelivery.LearningDeliveryFAMs, LearningDeliveryFAMTypeConstants.LSF);