Files
chapter-organizer/WebApp/appsettings.json
T
poprhythm 1c7e704ad3 Add comprehensive validation system with runtime configuration
Implements a flexible validation framework for student rankings, team assignments, and team composition with administrator-configurable rules and thresholds.

Validation System:
- Reflection-based rule discovery eliminates manual registration
- Base classes (RequiredEventTypeRuleBase, EventCountThresholdRuleBase) reduce code duplication by ~250 lines
- 12 validation rules covering event requirements, counts, and team constraints
- Configurable severity levels (Warning/Error) per rule type
- ValidationService with caching for optimal performance
- Rules apply contextually (StudentRanking, StudentAssignment, TeamComposition)

Configuration & Admin UI:
- ValidationSettings admin page for editing thresholds and severity levels
- ChapterSettings admin page for editing chapter information
- Settings stored in Data/appsettings.json for runtime configuration
- JSON config works in both development and production environments
- Auto-creates Data directory and config template on first run

User Experience:
- ValidationWarnings component displays inline warnings/errors
- Integrated in Event Ranking, Registration, and Team Assignment pages
- Color-coded severity indicators (warning yellow, error red)
- Includes "Too Many Regional Events" rule (max 3 recommended)

Technical Improvements:
- Template Method pattern for rule base classes
- Singleton rule instances with lazy initialization
- Configuration loaded via IConfiguration with fallback to defaults
- Safe JSON updates preserve other appsettings sections
2025-12-13 22:15:16 -05:00

40 lines
1.0 KiB
JSON

{
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.AspNetCore": "Warning",
"System": "Warning"
}
}
},
"AllowedHosts": "*",
"ChapterSettings": {
"Name": "Your Chapter Name",
"ShortName": "YCN",
"NationalId": "0000",
"StateId": "00000",
"RegionalId": "00000",
"CompetitionYear": "2026"
},
"ValidationSettings": {
"MinRecommendedEvents": 2,
"MaxRecommendedEvents": 4,
"MinCriticalEvents": 1,
"MaxCriticalEvents": 6,
"MaxRegionalEvents": 3,
"RequireRegionalEvent": true,
"RequireOnSiteActivity": true,
"RequireIndividualEvent": false,
"RequireTeamCaptain": true,
"NoRegionalEventSeverity": "Warning",
"NoOnSiteActivitySeverity": "Warning",
"NoIndividualEventSeverity": "Warning",
"TeamSizeSeverity": "Warning",
"EventCountSeverity": "Warning",
"MissingCaptainSeverity": "Warning",
"TooManyRegionalEventsSeverity": "Warning"
}
}