Add EventOccurrenceParserService and update service registrations

Registered the new EventOccurrenceParserService in Program.cs to handle event occurrence parsing. Updated the _Imports.razor file to reflect the renaming of the EventCalendar component to Calendar. Removed the obsolete EventCalendar component to streamline the codebase.
This commit is contained in:
2025-12-27 18:56:08 -05:00
parent 3a809f18a6
commit cd34be1f82
9 changed files with 487 additions and 58 deletions
+37
View File
@@ -0,0 +1,37 @@
using Core.Entities;
namespace Core.Models;
/// <summary>
/// Result of parsing event occurrence text data.
/// Contains parsed occurrences, errors, and warnings.
/// </summary>
public class EventOccurrenceParseResult
{
/// <summary>
/// Dictionary of parsed event occurrences, keyed by EventDefinition.
/// For special events (GeneralSchedule/VotingDelegates), the EventDefinition key will be the static instance.
/// </summary>
public IDictionary<EventDefinition, List<EventOccurrence>> Occurrences { get; set; } = new Dictionary<EventDefinition, List<EventOccurrence>>();
/// <summary>
/// List of parsing errors (critical issues that prevented parsing).
/// </summary>
public List<string> Errors { get; set; } = new();
/// <summary>
/// List of parsing warnings (non-critical issues that occurred during parsing).
/// </summary>
public List<string> Warnings { get; set; } = new();
/// <summary>
/// Total number of event occurrences successfully parsed.
/// </summary>
public int TotalParsed => Occurrences.Values.Sum(list => list.Count);
/// <summary>
/// Indicates whether parsing was successful (no errors).
/// </summary>
public bool IsSuccess => Errors.Count == 0;
}