/// <summary> /// Determines whether [has higher ed] [the specified delivery]. /// </summary> /// <param name="delivery">The delivery.</param> /// <returns> /// <c>true</c> if [has higher ed] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public bool HasHigherEd(ILearningDelivery delivery) => It.Has(delivery.LearningDeliveryHEEntity);
/// <summary> /// Determines whether [has qualifying employment] [this employment]. /// </summary> /// <param name="thisEmployment">this employment.</param> /// <returns> /// <c>true</c> if [has qualifying employment] [this employment]; otherwise, <c>false</c>. /// </returns> public bool HasQualifyingEmployment(ILearnerEmploymentStatus thisEmployment) => It.Has(thisEmployment);
/// <summary> /// Gets the last delivery. /// </summary> /// <param name="learner">The learner.</param> /// <returns>returns the last learning delivery (or null)</returns> public ILearningDelivery GetLastDelivery(ILearner learner) => learner.LearningDeliveries? .Where(x => It.Has(x.LearnActEndDateNullable)) .OrderByDescending(x => x.LearnActEndDateNullable.Value) .FirstOrDefault();
/// <summary> /// Determines whether [is completed short course] [the specified delivery]. /// </summary> /// <param name="delivery">The delivery.</param> /// <returns> /// <c>true</c> if [is completed short course] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public bool IsCompletedShortCourse(ILearningDelivery delivery) => It.Has(delivery.LearnActEndDateNullable) && ((delivery.LearnActEndDateNullable.Value - delivery.LearnStartDate) < FiveDays);
/// <summary> /// Condition met. /// </summary> /// <param name="thisDelivery">this learning delivery.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDelivery thisDelivery) { return(It.Has(thisDelivery) ? It.HasValues(thisDelivery.AppFinRecords) : true); }
/// <summary> /// Determines whether the specified employment status record has qualifying start date /// </summary> /// <param name="employment">The employment.</param> /// <param name="minStart">The minimum start.</param> /// <param name="maxStart">The maximum start (if null sets to today).</param> /// <returns> /// <c>true</c> if [has qualifying start] [the specified employment]; otherwise, <c>false</c>. /// </returns> public bool HasQualifyingStart(ILearnerEmploymentStatus employment, DateTime minStart, DateTime?maxStart = null) => It.Has(employment) && It.IsBetween(employment.DateEmpStatApp, minStart, maxStart ?? DateTime.MaxValue);
/// <summary> /// Condition met. /// as this juncture the prog type cannot be null... /// </summary> /// <param name="thisDelivery">this delivery.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDelivery thisDelivery) { return(It.Has(thisDelivery) ? It.Has(thisDelivery.ProgTypeNullable) && TypeOfLearningProgramme.AsASet.Contains((int)thisDelivery.ProgTypeNullable) : true); }
/// <summary> /// Determines whether [the specified lookup key] [contains] the value. /// </summary> /// <param name="lookupKey">The lookup key.</param> /// <param name="candidate">The candidate.</param> /// <returns> /// <c>true</c> if [the specified lookup] [contains]; otherwise, <c>false</c>. /// </returns> public bool Contains(TypeOfStringCodedLookup lookupKey, string candidate) { return(It.Has(candidate) && InternalCache.StringLookups[lookupKey].Contains(candidate)); }
/// <summary> /// Determines whether [has matching standard code] [the specified delivery]. /// </summary> /// <param name="delivery">The delivery.</param> /// <param name="candidate">The candidate.</param> /// <returns> /// <c>true</c> if [has matching standard code] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public bool HasMatchingStandardCode(ILearningDelivery delivery, ILearningDelivery candidate) => It.Has(delivery?.StdCodeNullable) && delivery.StdCodeNullable == candidate.StdCodeNullable;
/// <summary> /// Condition met. /// </summary> /// <param name="thisDelivery">this learning delivery.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDelivery thisDelivery) { return(It.Has(thisDelivery) ? It.Has(thisDelivery.ProgTypeNullable) : true); }
/// <summary> /// Determines whether [contains] [the specified lookup key]. /// </summary> /// <param name="lookupKey">The lookup key.</param> /// <param name="keyCandidate">The candidate.</param> /// <returns> /// <c>true</c> if [contains] [the specified lookup key]; otherwise, <c>false</c>. /// </returns> public bool Contains(TypeOfLimitedLifeLookup lookupKey, string keyCandidate) { return(It.Has(keyCandidate) && InternalCache.LimitedLifeLookups[lookupKey].ContainsKey(keyCandidate)); }
/// <summary> /// Determines whether [is higher achiever] [the specified candidate]. /// </summary> /// <param name="candidate">The candidate.</param> /// <returns> /// <c>true</c> if [is higher achiever] [the specified candidate]; otherwise, <c>false</c>. /// </returns> public bool IsHigherAchiever(ILearner candidate) => It.Has(candidate.PriorAttainNullable) && It.IsInRange(candidate.PriorAttainNullable.Value, TypeOfPriorAttainment.AsHigherLevelAchievements);
/// <summary> /// Determines whether [is target age group] [the specified learner]. /// </summary> /// <param name="learner">The learner.</param> /// <param name="delivery">The delivery.</param> /// <returns> /// <c>true</c> if [is target age group] [the specified learner]; otherwise, <c>false</c>. /// </returns> public bool IsTargetAgeGroup(ILearner learner, ILearningDelivery delivery) => It.Has(learner.DateOfBirthNullable) && It.IsBetween(delivery.LearnStartDate - learner.DateOfBirthNullable.Value, MinimumViableAge, MaximumViableAge);
/// <summary> /// Determines whether the specified he has domicile. /// </summary> /// <param name="he">The higher ed.</param> /// <returns> /// <c>true</c> if the specified he has domicile; otherwise, <c>false</c>. /// </returns> public bool HasDomicile(ILearningDeliveryHE he) => It.Has(he.DOMICILE);
/// <summary> /// get message... /// </summary> /// <param name="forTheSubmittedValue">for hte submitted value</param> /// <returns></returns> public static string GetMessage(string forTheSubmittedValue = null) => It.Has(forTheSubmittedValue) ? $"Invalid postcode submitted: '{forTheSubmittedValue}'" : "Invalid postcode submitted";
/// <summary> /// Condition met. /// </summary> /// <param name="thisDelivery">this delivery.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDelivery thisDelivery) { return(It.Has(thisDelivery) ? It.HasValues(thisDelivery.LearningDeliveryWorkPlacements) : true); }
/// <summary> /// Determines whether the specified learning delivery has qualifying start date /// </summary> /// <param name="delivery">The delivery.</param> /// <param name="minStart">The minimum start.</param> /// <param name="maxStart">The maximum start (if null sets to today).</param> /// <returns> /// <c>true</c> if [has qualifying start] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public bool HasQualifyingStart(ILearningDelivery delivery, DateTime minStart, DateTime?maxStart = null) => It.Has(delivery) && It.IsBetween(delivery.LearnStartDate, minStart, maxStart ?? DateTime.MaxValue);
/// <summary> /// Determines whether [has matching contract reference] [the specified source and candidate]. /// </summary> /// <param name="source">The source.</param> /// <param name="candidate">The candidate.</param> /// <returns> /// <c>true</c> if [has matching contract reference] [the specified source]; otherwise, <c>false</c>. /// </returns> public bool HasMatchingContractReference(ILearningDelivery source, ILearningDelivery candidate) => It.Has(source.ConRefNumber) && source.ConRefNumber.ComparesWith(candidate.ConRefNumber);
/// <summary> /// Condition met. /// </summary> /// <param name="financialRecord">The financial record.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(IAppFinRecord financialRecord) { return(It.Has(financialRecord) ? It.IsInRange($"{financialRecord.AFinType}{financialRecord.AFinCode}", ApprenticeshipFinancialRecord.TotalAssessmentPrice, ApprenticeshipFinancialRecord.ResidualAssessmentPrice) : true); }
/// <summary> /// Condition met. /// </summary> /// <param name="famRecord">The (learning delivery) fam record.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDeliveryFAM famRecord) { return(It.Has(famRecord) ? It.IsInRange(famRecord.LearnDelFAMType, Monitoring.Delivery.Types.SourceOfFunding) : true); }
/// <summary> /// Determines whether [is not valid] [the specified delivery]. /// </summary> /// <param name="thisDelivery">this delivery.</param> /// <returns> /// <c>true</c> if [is not valid] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public bool IsNotValid(ILearningDelivery thisDelivery) => !_check.IsRestart(thisDelivery) && _check.IsStandardApprencticeship(thisDelivery) && _check.InAProgramme(thisDelivery) && It.Has(thisDelivery.StdCodeNullable) && !HasQualifyingStart(thisDelivery, GetStandardPeriodsOfValidityFor(thisDelivery));
/// <summary> /// Determines whether [has qualifying start] [the specified this delivery]. /// </summary> /// <param name="thisDelivery">this delivery.</param> /// <param name="allocation">The allocation.</param> /// <returns> /// <c>true</c> if [has qualifying start] [the specified this delivery]; otherwise, <c>false</c>. /// </returns> public bool HasQualifyingStart(ILearningDelivery thisDelivery, IFcsContractAllocation allocation) => It.Has(allocation) && It.Has(allocation.StartDate) && _check.HasQualifyingStart(thisDelivery, allocation.StartDate.Value);
/// <summary> /// Condition met. /// </summary> /// <param name="thisDelivery">this learning delivery.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDelivery thisDelivery) { return(It.Has(thisDelivery) ? thisDelivery.AppFinRecords.SafeAny(afr => It.IsInRange(afr.AFinType, ApprenticeshipFinancialRecord.Types.TotalNegotiatedPrice)) : true); }
/// <summary> /// Determines whether [has original learning start date] [the specified delivery]. /// </summary> /// <param name="delivery">The delivery.</param> /// <returns> /// <c>true</c> if [has original learning start date] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public bool HasOriginalLearningStartDate(ILearningDelivery delivery) => It.Has(delivery.OrigLearnStartDateNullable);
/// <summary> /// Condition met. /// </summary> /// <param name="thisDelivery">this delivery.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDelivery thisDelivery) { return(It.Has(thisDelivery) && It.IsEmpty(thisDelivery.LearnActEndDateNullable) ? TypeOfLearningProgramme.WithinMaxmimumOpenTrainingDuration(thisDelivery.LearnStartDate, _fileData.FilePreparationDate()) : true); }
/// <summary> /// Determines whether [is usable subject area] [the specified subject area level]. /// </summary> /// <param name="subjectAreaLevel">The subject area level.</param> /// <returns> /// <c>true</c> if [is usable subject area] [the specified subject area level]; otherwise, <c>false</c>. /// </returns> public bool IsUsableSubjectArea(IEsfEligibilityRuleSectorSubjectAreaLevel subjectAreaLevel) => It.Has(subjectAreaLevel) && It.IsEmpty(subjectAreaLevel.SectorSubjectAreaCode) && (It.Has(subjectAreaLevel.MinLevelCode) || It.Has(subjectAreaLevel.MaxLevelCode));
/// <summary> /// Determines whether [has completed course] [the specified delivery]. /// </summary> /// <param name="delivery">The delivery.</param> /// <returns> /// <c>true</c> if [has completed course] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public bool HasCompletedCourse(ILearningDelivery delivery) => It.Has(delivery.LearnActEndDateNullable);
/// <summary> /// Condition met. /// </summary> /// <param name="thisDelivery">this learning delivery.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDelivery thisDelivery) { return(It.Has(thisDelivery) ? thisDelivery.AppFinRecords?.Any(afr => It.IsInRange(afr.AFinType, TypeOfAppFinRec.TotalNegotiatedPrice)) ?? false : true); }
/// <summary> /// Determines whether [is target age group] [the specified learner]. /// </summary> /// <param name="learner">The learner.</param> /// <param name="delivery">The delivery.</param> /// <returns> /// <c>true</c> if [is target age group] [the specified learner]; otherwise, <c>false</c>. /// </returns> public bool IsTargetAgeGroup(ILearner learner, ILearningDelivery delivery) => It.Has(learner.DateOfBirthNullable) && (delivery.LearnStartDate - learner.DateOfBirthNullable.Value) >= MinimumViableAge;
/// <summary> /// Condition met. /// </summary> /// <param name="thisDelivery">this delivery.</param> /// <returns> /// true if any any point the conditions are met /// </returns> public bool ConditionMet(ILearningDelivery thisDelivery) { return(It.Has(thisDelivery) && It.Has(thisDelivery.LearnActEndDateNullable) ? TypeOfLearningProgramme.WithinMaxmimumTrainingDuration(thisDelivery.LearnStartDate, thisDelivery.LearnActEndDateNullable.Value) : true); }