public bool ConditionMet(ILearningDeliveryFAM learningDeliveryFam, IReadOnlyCollection <ILearningDeliveryFAM> learningDeliveryFaMs) { var learningDeliveryFaMsHhsCount = _learningDeliveryFAMQueryService.GetLearningDeliveryFAMsCountByFAMType(learningDeliveryFaMs, LearningDeliveryFAMTypeConstants.HHS); if (learningDeliveryFam?.LearnDelFAMType == LearningDeliveryFAMTypeConstants.HHS && learningDeliveryFaMsHhsCount == 2 && !validFamCodes.Contains(learningDeliveryFam.LearnDelFAMCode)) { return(true); } return(false); }
public void Validate(ILearner learner) { if (learner?.LearningDeliveries == null) { return; } foreach (var learningDelivery in learner.LearningDeliveries) { var famCount = _learningDeliveryFAMQueryService.GetLearningDeliveryFAMsCountByFAMType(learningDelivery.LearningDeliveryFAMs, LearningDeliveryFAMTypeConstants.DAM); if (famCount > MaxOccurences) { RaiseValidationMessage(learner.LearnRefNumber, learningDelivery); } } }
public bool DoesNotHaveMultipleACTFams(IReadOnlyCollection <ILearningDeliveryFAM> learningDeliveryFAMs) { return(_learningDeliveryFAMQueryService.GetLearningDeliveryFAMsCountByFAMType(learningDeliveryFAMs, _famTypeACT) < 2); }
public bool ConditionMet(IReadOnlyCollection <ILearningDeliveryFAM> learningDeliveryFAMs) { return(_learningDeliveryFAMQueryService.GetLearningDeliveryFAMsCountByFAMType(learningDeliveryFAMs, LearningDeliveryFAMTypeConstants.HHS) > 2); }
public bool ConditionMet(string learnDelFamType, IReadOnlyCollection <ILearningDeliveryFAM> learningDeliveryFaMs) { return(_learnDelfamTypes.Contains(learnDelFamType) && _learningDeliveryFAMQueryService.GetLearningDeliveryFAMsCountByFAMType( learningDeliveryFaMs, learnDelFamType) > 1); }