Stores scheduler page display preferences per user

This commit is contained in:
BinaryAlley committed 2026-09-03 14:06:01 -07:00
1 parent ab8ab51397
commit 237be9e2c8
50 files changed
+3144 -60

No files matched your search

@@ -0,0 +1,22 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Scheduling;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.DTO.Scheduling;
/// <summary>
/// Data transfer object for the display preferences of the scheduler page.
/// </summary>
/// <param name="UserId">The unique identifier of the user that owns the display preferences.</param>
/// <param name="JobTypeFilter">The type of the scheduled job tasks whose executions are shown on the scheduler page, or <see langword="null"/> when all of them are shown.</param>
/// <param name="DisplayTimeSpan">The time span, expressed in <paramref name="DisplayTimeUnit"/>, that the scheduler page shows.</param>
/// <param name="DisplayTimeUnit">The unit in which the displayed time span of the scheduler page is expressed.</param>
[DebuggerDisplay("UserId: {UserId}, DisplayTimeSpan: {DisplayTimeSpan} {DisplayTimeUnit}")]
public record SchedulerDisplayPreferencesDto(
Guid UserId,
ScheduledTaskType? JobTypeFilter,
int DisplayTimeSpan,
SchedulerDisplayTimeUnit DisplayTimeUnit
);
@@ -0,0 +1,22 @@
namespace Lumina.Presentation.Web.Common.Enums.Scheduling;
/// <summary>
/// Enumeration for the units in which the display time span of the scheduler page is expressed.
/// </summary>
public enum SchedulerDisplayTimeUnit
{
/// <summary>
/// The display time span is expressed in minutes.
/// </summary>
Minutes,
/// <summary>
/// The display time span is expressed in hours.
/// </summary>
Hours,
/// <summary>
/// The display time span is expressed in days.
/// </summary>
Days
}
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.Scheduling;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Requests.Scheduling;
/// <summary>
/// Request for updating the display preferences of the scheduler page of the current user.
/// </summary>
/// <param name="JobTypeFilter">The type of the scheduled job tasks whose executions are shown on the scheduler page, or <see langword="null"/> when all of them are shown.</param>
/// <param name="DisplayTimeSpan">The time span, expressed in <paramref name="DisplayTimeUnit"/>, that the scheduler page shows. Required.</param>
/// <param name="DisplayTimeUnit">The unit in which the displayed time span of the scheduler page is expressed. Required.</param>
[DebuggerDisplay("DisplayTimeSpan: {DisplayTimeSpan} {DisplayTimeUnit}")]
public record UpdateSchedulerDisplayPreferencesRequest(
ScheduledTaskType? JobTypeFilter,
int DisplayTimeSpan,
SchedulerDisplayTimeUnit DisplayTimeUnit
);
@@ -17,5 +17,7 @@ public static partial class ApiRoutes
public const string START_SCHEDULED_JOB = "scheduled-jobs/{scheduledJobId}/start";
public const string STOP_SCHEDULED_JOB = "scheduled-jobs/{scheduledJobId}/stop";
public const string FIRE_SCHEDULED_JOB = "scheduled-jobs/{scheduledJobId}/fire";
public const string GET_DISPLAY_PREFERENCES = "scheduled-jobs/display-preferences";
public const string UPDATE_DISPLAY_PREFERENCES = "scheduled-jobs/display-preferences";
}
}
@@ -18,5 +18,7 @@ public static partial class WebRoutes
public const string START_SCHEDULED_JOB = "{culture}/admin/api-scheduled-jobs/{scheduledJobId}/start";
public const string STOP_SCHEDULED_JOB = "{culture}/admin/api-scheduled-jobs/{scheduledJobId}/stop";
public const string FIRE_SCHEDULED_JOB = "{culture}/admin/api-scheduled-jobs/{scheduledJobId}/fire";
public const string GET_DISPLAY_PREFERENCES = "{culture}/admin/api-scheduled-jobs/display-preferences";
public const string UPDATE_DISPLAY_PREFERENCES = "{culture}/admin/api-scheduled-jobs/display-preferences";
}
}