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
@@ -0,0 +1,28 @@
namespace GoogleSheetsScheduleImport;
/// <summary>
/// Normalized grid: row 0 = location headers (col 0 empty or ignored), column 0 = time labels (row 0 ignored).
/// </summary>
public sealed class GridSheetModel
{
public required string SheetTitle { get; init; }
/// <summary>display values, sanitized hyphens; [row][col]</summary>
public required string?[][] Values { get; init; }
/// <summary>Optional RGB hex backgrounds for block grouping (#RRGGBB or null)</summary>
public required string?[][]? BackgroundKeys { get; init; }
public int RowCount => Values.Length;
public int ColCount => Values.Length == 0 ? 0 : Values[0].Length;
}
public readonly record struct ParsedOccurrenceLine(
string Name,
string Month,
int Day,
string TimeRange,
string Location,
int SourceRowStart,
int SourceRowEnd,
int SourceCol);