Event details page navigation, handling of attendees in Outlook synchronizer, navigation changes for calendar.

This commit is contained in:
Burak Kaan Köse
2025-01-16 22:00:05 +01:00
parent 56d6c22d53
commit 7cfa5a57f5
21 changed files with 374 additions and 99 deletions

View File

@@ -55,21 +55,11 @@ namespace Wino.Core.Domain.Entities.Calendar
}
/// <summary>
/// Events that are either an exceptional instance of a recurring event or a recurring event itself.
/// Events that are either an exceptional instance of a recurring event or occurrences.
/// IsOccurrence is used to display occurrence instances of parent recurring events.
/// IsOccurrence == false && IsRecurringChild == true => exceptional single instance.
/// </summary>
public bool IsRecurringEvent
{
get
{
return !string.IsNullOrEmpty(Recurrence) || RecurringCalendarItemId != null;
}
}
/// <summary>
/// Events that are belong to parent recurring event, but updated individually are considered single exceptional instances.
/// They will have different Id of their own.
/// </summary>
public bool IsSingleExceptionalInstance
public bool IsRecurringChild
{
get
{
@@ -77,6 +67,22 @@ namespace Wino.Core.Domain.Entities.Calendar
}
}
/// <summary>
/// Events that are either an exceptional instance of a recurring event or occurrences.
/// </summary>
public bool IsRecurringEvent => IsRecurringChild || IsRecurringParent;
/// <summary>
/// Events that are the master event definition of recurrence events.
/// </summary>
public bool IsRecurringParent
{
get
{
return !string.IsNullOrEmpty(Recurrence) && RecurringCalendarItemId == null;
}
}
/// <summary>
/// Events that are not all-day events and last more than one day are considered multi-day events.
/// </summary>
@@ -124,6 +130,20 @@ namespace Wino.Core.Domain.Entities.Calendar
[Ignore]
public IAccountCalendar AssignedCalendar { get; set; }
/// <summary>
/// Whether this item does not really exist in the database or not.
/// These are used to display occurrence instances of parent recurring events.
/// </summary>
[Ignore]
public bool IsOccurrence { get; set; }
/// <summary>
/// Id to load information related to this event.
/// Occurrences tracked by the parent recurring event if they are not exceptional instances.
/// Recurring children here are exceptional instances. They have their own info in the database including Id.
/// </summary>
public Guid EventTrackingId => IsOccurrence ? RecurringCalendarItemId.Value : Id;
public CalendarItem CreateRecurrence(DateTime startDate, double durationInSeconds)
{
// Create a copy with the new start date and duration
@@ -153,6 +173,7 @@ namespace Wino.Core.Domain.Entities.Calendar
RemoteEventId = RemoteEventId,
IsHidden = IsHidden,
IsLocked = IsLocked,
IsOccurrence = true
};
}
}

View File

@@ -0,0 +1,8 @@
namespace Wino.Core.Domain.Enums
{
public enum CalendarEventTargetType
{
Single, // Show details for a single event.
Series // Show the series event. Parent of all recurring events.
}
}

View File

@@ -13,9 +13,11 @@ namespace Wino.Core.Domain.Interfaces
double DurationInSeconds { get; set; }
ITimePeriod Period { get; }
bool IsRecurringEvent { get; }
bool IsAllDayEvent { get; }
bool IsMultiDayEvent { get; }
bool IsSingleExceptionalInstance { get; }
bool IsRecurringChild { get; }
bool IsRecurringParent { get; }
bool IsRecurringEvent { get; }
}
}

View File

@@ -19,5 +19,14 @@ namespace Wino.Core.Domain.Interfaces
Task<List<CalendarItem>> GetCalendarEventsAsync(IAccountCalendar calendar, DayRangeRenderModel dayRangeRenderModel);
Task<CalendarItem> GetCalendarItemAsync(Guid accountCalendarId, string remoteEventId);
Task UpdateCalendarDeltaSynchronizationToken(Guid calendarId, string deltaToken);
/// <summary>
/// Returns the correct calendar item based on the target details.
/// </summary>
/// <param name="targetDetails">Target details.</param>
Task<CalendarItem> GetCalendarItemTargetAsync(CalendarItemTarget targetDetails);
Task<CalendarItem> GetCalendarItemAsync(Guid id);
Task<List<CalendarEventAttendee>> GetAttendeesAsync(Guid calendarEventTrackingId);
Task<List<CalendarEventAttendee>> ManageEventAttendeesAsync(Guid calendarItemId, List<CalendarEventAttendee> allAttendees);
}
}

View File

@@ -0,0 +1,7 @@
using Wino.Core.Domain.Entities.Calendar;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Models.Calendar
{
public record CalendarItemTarget(CalendarItem Item, CalendarEventTargetType TargetType);
}