Files
chapter-organizer/Core/Models/EventOccurrenceParseResult.cs
T
poprhythm cd34be1f82 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.
2025-12-27 18:57:56 -05:00

38 lines
1.2 KiB
C#

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;
}