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.
29 lines
880 B
C#
29 lines
880 B
C#
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);
|