Files
chapter-organizer/Core/Validation/Rules/StudentAssignmentRules/NoOnSiteActivityAssignmentRule.cs
T
poprhythm 45edcf5e5f Refactor event assignment structure and introduce new models for assignment parameters and requirements
This commit removes the obsolete EventAssignment class from Core.Entities and introduces new models in Core.Models, including AssignmentParameters, AssignmentRequirement, PartialTeam, and StudentEventStatistics. The changes enhance the organization of assignment-related data and improve the overall structure of the codebase. Additionally, several files have been updated to include references to the new Core.Models namespace, ensuring consistency across the application.
2026-01-10 18:36:52 -05:00

24 lines
884 B
C#

using Core.Entities;
using Core.Models;
using Core.Validation.Rules.BaseRules;
namespace Core.Validation.Rules.StudentAssignmentRules;
/// <summary>
/// Validation rule that checks if a student has been assigned at least one on-site activity
/// </summary>
public class NoOnSiteActivityAssignmentRule : RequiredEventTypeAssignmentRuleBase
{
protected override bool IsRequired(ValidationConfiguration config) => config.RequireOnSiteActivity;
protected override bool HasEventType(StudentEventStatistics statistics) => statistics.HasOnSiteActivity;
protected override ValidationSeverity GetSeverity(ValidationConfiguration config) => config.NoOnSiteActivitySeverity;
protected override string Code => "NO_ONSITE_ACTIVITY_ASSIGNED";
protected override string Message => "No On-Site Activity";
protected override string IconIdentifier => "OnSiteActivity";
}