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 individual event /// public class NoIndividualEventRule : RequiredEventTypeRuleBase { protected override bool IsRequired(ValidationConfiguration config) => config.RequireIndividualEvent; protected override bool HasEventType(Student student) => student.RankedEvents.Any(e => e.EventFormat == EventFormat.Individual); protected override ValidationSeverity GetSeverity(ValidationConfiguration config) => config.NoIndividualEventSeverity; protected override string Code => "NO_INDIVIDUAL_EVENT"; protected override string Message => "No Individual Event"; protected override string IconIdentifier => "IndividualEvent"; }