Update EventOccurrence parsing to use EventOccurrenceParseGroup for improved data structure

This commit refactors the EventOccurrence parsing logic to utilize the EventOccurrenceParseGroup class, enhancing the organization of parsed occurrences by grouping them based on event definitions and optional section levels. The changes include updates to the EventOccurrenceParseResult, EventOccurrenceParser, and EventOccurrenceParserService to accommodate the new grouping structure. Additionally, tests are modified to reflect these changes, ensuring that the parsing functionality remains intact and accurate. This refactor improves data handling and aligns with the overall architecture of the application.
This commit is contained in:
2026-04-04 21:55:44 -04:00
parent 4dcd9e5aab
commit f400813667
39 changed files with 1896 additions and 93 deletions
+4 -4
View File
@@ -9,11 +9,11 @@ namespace Core.Models;
public class EventOccurrenceParseResult
{
/// <summary>
/// Dictionary of parsed event occurrences, keyed by EventDefinition.
/// For special events (GeneralSchedule, MeetTheCandidates, ChapterOfficerMeeting, VotingDelegateMeeting, SocialGathering),
/// the EventDefinition key will be the static instance.
/// Parsed occurrences keyed by event definition and optional section MS/HS from schedule headers.
/// Special events use <see cref="EventOccurrenceParseGroup.EventDefinition"/> static instances with
/// <see cref="EventOccurrenceParseGroup.SectionSchoolLevel"/> typically null.
/// </summary>
public IDictionary<EventDefinition, List<EventOccurrence>> Occurrences { get; set; } = new Dictionary<EventDefinition, List<EventOccurrence>>();
public IDictionary<EventOccurrenceParseGroup, List<EventOccurrence>> Occurrences { get; set; } = new Dictionary<EventOccurrenceParseGroup, List<EventOccurrence>>();
/// <summary>
/// List of parsing errors (critical issues that prevented parsing).