From b72e9b073cbcf39f185cf27bf82e20b13989fc48 Mon Sep 17 00:00:00 2001 From: Claudio Schaad Date: Fri, 10 Apr 2026 22:37:16 +0200 Subject: [PATCH] feat: add CalendarInfo shared DTO, retire GoogleCalendar Creates the new CalendarInfo shared DTO to replace GoogleCalendar with a more generic name suitable for both Google Calendar and Nextcloud CalDAV integration. Updates client-side references to use CalendarInfo instead of GoogleCalendar. Co-Authored-By: Claude Sonnet 4.6 --- Client/Pages/Index.razor.cs | 4 ++-- Shared/CalendarInfo.cs | 7 +++++++ Shared/GoogleCalendar.cs | 9 ++------- 3 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 Shared/CalendarInfo.cs diff --git a/Client/Pages/Index.razor.cs b/Client/Pages/Index.razor.cs index 8ba616f..cc72645 100644 --- a/Client/Pages/Index.razor.cs +++ b/Client/Pages/Index.razor.cs @@ -23,7 +23,7 @@ namespace ShiftScheduler.Client.Pages private bool _showCalendarSelector = false; private string _errorMessage = string.Empty; private string _successMessage = string.Empty; - private List _availableCalendars = new(); + private List _availableCalendars = new(); private MonthAndYear SelectedDate => _isCurrentMonth ? MonthAndYear.Current() : MonthAndYear.Next(); @@ -185,7 +185,7 @@ namespace ShiftScheduler.Client.Pages var response = await HttpClient.GetAsync("api/shift/google_calendars"); if (response.IsSuccessStatusCode) { - _availableCalendars = await response.Content.ReadFromJsonAsync>() ?? new(); + _availableCalendars = await response.Content.ReadFromJsonAsync>() ?? new(); if (_availableCalendars.Count == 1) { diff --git a/Shared/CalendarInfo.cs b/Shared/CalendarInfo.cs new file mode 100644 index 0000000..a7df061 --- /dev/null +++ b/Shared/CalendarInfo.cs @@ -0,0 +1,7 @@ +namespace ShiftScheduler.Shared; + +public class CalendarInfo +{ + public string Id { get; set; } = string.Empty; + public string Summary { get; set; } = string.Empty; +} diff --git a/Shared/GoogleCalendar.cs b/Shared/GoogleCalendar.cs index 81ca4e0..b8318b6 100644 --- a/Shared/GoogleCalendar.cs +++ b/Shared/GoogleCalendar.cs @@ -1,7 +1,2 @@ -namespace ShiftScheduler.Shared; - -public class GoogleCalendar -{ - public string Id { get; set; } = string.Empty; - public string Summary { get; set; } = string.Empty; -} \ No newline at end of file +// Class renamed to CalendarInfo — see Shared/CalendarInfo.cs +namespace ShiftScheduler.Shared; \ No newline at end of file