public void Validate(ILearner objectToValidate)
        {
            var learnRefNumber   = objectToValidate.LearnRefNumber;
            var learnerHE        = objectToValidate.LearnerHEEntity;
            var tTAccom          = learnerHE?.TTACCOMNullable;
            var referenceDate    = _derivedData06.Derive(objectToValidate.LearningDeliveries);
            var failedValidation = !ConditionMet(tTAccom, referenceDate);

            if (failedValidation)
            {
                RaiseValidationMessage(learnRefNumber, tTAccom.Value);
            }
        }
Ejemplo n.º 2
0
        public void Validate(ILearner objectToValidate)
        {
            var dd06Date = _dd06.Derive(objectToValidate.LearningDeliveries);

            if (ConditionMet(
                    objectToValidate.LLDDHealthProb,
                    objectToValidate.LLDDAndHealthProblems,
                    objectToValidate.LearningDeliveries,
                    objectToValidate.DateOfBirthNullable,
                    dd06Date))
            {
                HandleValidationError(objectToValidate.LearnRefNumber);
            }
        }
Ejemplo n.º 3
0
        public void Validate(ILearner objectToValidate)
        {
            if (objectToValidate.LearningDeliveries == null || objectToValidate.LearnerFAMs == null)
            {
                return;
            }

            var dd06Date = _derivedData06.Derive(objectToValidate.LearningDeliveries);

            foreach (var learnerFam in objectToValidate.LearnerFAMs)
            {
                if (ConditionMet(learnerFam, dd06Date))
                {
                    HandleValidationError(objectToValidate.LearnRefNumber);
                }
            }
        }
Ejemplo n.º 4
0
 public DateTime GetQualifyingStartDate(IReadOnlyCollection <ILearningDelivery> usingSources) =>
 _derivedData.Derive(usingSources);
Ejemplo n.º 5
0
        private bool ExceptionApplies(DateTime?dateOfBirth, IEnumerable <ILearningDelivery> learningDeliveries)
        {
            var startDate = _derivedData06.Derive(learningDeliveries);

            return(_dateTimeQueryService.AgeAtGivenDate(dateOfBirth ?? DateTime.MaxValue, startDate) >= MaxRuleAge);
        }
Ejemplo n.º 6
0
 public bool LearnStartDateConditionMet(IEnumerable <ILearningDelivery> learningDeliveries) =>
 _dd06.Derive(learningDeliveries) >= _augustFirst2013;
 public bool LearnStartDateConditionMet(IEnumerable <ILearningDelivery> learningDeliveries)
 {
     return(_dd06.Derive(learningDeliveries) >= _firstAugust2015);
 }
Ejemplo n.º 8
0
 public bool ConditionMet(int llddCat, IEnumerable <ILearningDelivery> learningDeliveries)
 {
     return(_provideLookupDetails.Contains(TypeOfLimitedLifeLookup.LLDDCat, llddCat) &&
            !_provideLookupDetails.IsCurrent(TypeOfLimitedLifeLookup.LLDDCat, llddCat, _dd06.Derive(learningDeliveries)));
 }