/// <summary> /// Determines whether the specified eligibility codes contains code. /// </summary> /// <param name="eligibilityCodes">The eligibility codes.</param> /// <param name="candidate">The candidate.</param> /// <returns> /// <c>true</c> if the specified eligibility codes contains code; otherwise, <c>false</c>. /// </returns> public bool ContainsCode(IContainThis <string> eligibilityCodes, string candidate) => eligibilityCodes.Contains(candidate);
/// <summary> /// Determines whether [has any qualifying eligibility] [the specified delivery]. /// </summary> /// <param name="delivery">The delivery.</param> /// <param name="postcodes">The postcodes.</param> /// <param name="eligibilityCodes">The eligibility codes.</param> /// <returns> /// <c>true</c> if [has any qualifying eligibility] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public abstract bool HasAnyQualifyingEligibility(ILearningDelivery delivery, IReadOnlyCollection <IONSPostcode> postcodes, IContainThis <string> eligibilityCodes);
/// <summary> /// Determines whether [has qualifying eligibility] [the specified delivery]. /// </summary> /// <param name="delivery">The delivery.</param> /// <param name="postcodes">The postcodes.</param> /// <param name="eligibilityCodes">The eligibility codes.</param> /// <returns> /// <c>true</c> if [has qualifying eligibility] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public override bool HasAnyQualifyingEligibility(ILearningDelivery delivery, IReadOnlyCollection <IONSPostcode> postcodes, IContainThis <string> eligibilityCodes) => postcodes.Any(x => (ContainsCode(eligibilityCodes, x.Lep1) || ContainsCode(eligibilityCodes, x.Lep2)) && InQualifyingPeriod(delivery, x));
/// <summary> /// Determines whether [has any qualifying eligibility] [the specified delivery]. /// </summary> /// <param name="delivery">The delivery.</param> /// <param name="postcodes">The postcodes.</param> /// <param name="eligibilityCodes">The eligibility codes.</param> /// <returns> /// <c>true</c> if [has any qualifying eligibility] [the specified delivery]; otherwise, <c>false</c>. /// </returns> public override bool HasAnyQualifyingEligibility(ILearningDelivery delivery, IReadOnlyCollection <IONSPostcode> postcodes, IContainThis <string> eligibilityCodes) => postcodes.Any(x => eligibilityCodes.Contains(x.LocalAuthority) && InQualifyingPeriod(delivery, x));