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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user