Ejemplo n.º 1
0
        public bool CategoryRefConditionMet(ILearningDelivery learningDelivery)
        {
            var ddLookup         = _ddCategoryRef.Derive(learningDelivery);
            var larsCategoryRefs = _larsDataService.GetCategoriesFor(learningDelivery.LearnAimRef);

            return(larsCategoryRefs.Any(x => x.CategoryRef == ddLookup));
        }
Ejemplo n.º 2
0
        public bool ConditionMet(ILearningDelivery learningDelivery, IReadOnlyCollection <ILearnerEmploymentStatus> learnerEmploymentStatuses)
        {
            var validityCategory = _ddValidityCategory.Derive(learningDelivery, learnerEmploymentStatuses);
            var categoryRef      = _ddCategoryRef.Derive(learningDelivery);

            var validityCheck = validityCategory != null?
                                LarsValidityConditionMet(validityCategory, learningDelivery.LearnAimRef, learningDelivery.LearnStartDate) :
                                    false;

            var categoryCheck = categoryRef != null?
                                LarsCategoryConditionMet(categoryRef.Value, learningDelivery.LearnAimRef, learningDelivery.LearnStartDate) :
                                    false;

            return(TriggerOnValidityCategory(validityCategory, validityCheck) ? TriggerOnCategoryRef(categoryRef, categoryCheck) : false);
        }