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:
@@ -65,7 +65,8 @@ public class EventOccurrenceParserService : IEventOccurrenceParserService
|
||||
// Convert parsed occurrences to result format, handling special event types
|
||||
foreach (var kvp in parsedOccurrences)
|
||||
{
|
||||
var eventDefinition = kvp.Key;
|
||||
var group = kvp.Key;
|
||||
var eventDefinition = group.EventDefinition;
|
||||
var occurrences = kvp.Value;
|
||||
|
||||
// Check if this is a special event type (not stored in database)
|
||||
@@ -90,8 +91,7 @@ public class EventOccurrenceParserService : IEventOccurrenceParserService
|
||||
};
|
||||
}
|
||||
|
||||
// Add to result with the special EventDefinition as key
|
||||
result.Occurrences[eventDefinition] = occurrences;
|
||||
result.Occurrences[group] = occurrences;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -102,7 +102,7 @@ public class EventOccurrenceParserService : IEventOccurrenceParserService
|
||||
occurrence.SpecialEventType = null;
|
||||
}
|
||||
|
||||
result.Occurrences[eventDefinition] = occurrences;
|
||||
result.Occurrences[group] = occurrences;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user