using Core.Entities; using Core.Validation.Rules.BaseRules; namespace Core.Validation.Rules.StudentRankingRules; /// /// Validation rule that checks if a student has ranked at least one regional event /// public class NoRegionalEventRule : RequiredEventTypeRuleBase { protected override bool IsRequired(ValidationConfiguration config) => config.RequireRegionalEvent; protected override bool HasEventType(Student student) => student.RankedEvents.Any(e => e.RegionalEvent); protected override ValidationSeverity GetSeverity(ValidationConfiguration config) => config.NoRegionalEventSeverity; protected override string Code => "NO_REGIONAL_EVENT"; protected override string Message => "No Regional Event"; protected override string IconIdentifier => "RegionalEvent"; }