Completes the scheduled jobs module with default jobs, a themed scheduler page and aligned recovery semantics

This commit is contained in:
BinaryAlley committed 2026-09-04 13:56:04 -07:00
1 parent 99a6159f7f
commit 4b7cfbbe11
67 files changed
+3324 -745

No files matched your search

@@ -10,7 +10,7 @@ using System.Collections.Generic;
namespace Lumina.Domain.Core.BoundedContexts.SchedulingBoundedContext.ScheduledJobAggregate.ValueObjects;
/// <summary>
/// Represents a daily schedule for a scheduled job.
/// Value Object for the daily schedule for a scheduled job.
/// </summary>
public class DailySchedule : Schedule
{
@@ -1,6 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Errors;
using Lumina.Domain.Common.Models.Core;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
using System;
@@ -10,7 +9,7 @@ using System.Collections.Generic;
namespace Lumina.Domain.Core.BoundedContexts.SchedulingBoundedContext.ScheduledJobAggregate.ValueObjects;
/// <summary>
/// Represents an interval based schedule for a scheduled job.
/// Value Object for the interval based schedule for a scheduled job.
/// </summary>
public class IntervalSchedule : Schedule
{
@@ -0,0 +1,61 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
using System;
using System.Collections.Generic;
#endregion
namespace Lumina.Domain.Core.BoundedContexts.SchedulingBoundedContext.ScheduledJobAggregate.ValueObjects;
/// <summary>
/// Value Object for the schedule that fires the task of the scheduled job once, at every application startup.
/// </summary>
public class OnceAtStartupSchedule : Schedule
{
/// <summary>
/// Gets the type of the schedule.
/// </summary>
public override ScheduleType ScheduleType { get; } = ScheduleType.OnceAtStartup;
/// <summary>
/// Initializes a new instance of the <see cref="OnceAtStartupSchedule"/> class.
/// </summary>
private OnceAtStartupSchedule()
{
}
/// <summary>
/// Creates a new instance of the <see cref="OnceAtStartupSchedule"/> class.
/// </summary>
/// <returns>
/// An <see cref="Result{TValue}"/> containing either a successfully created <see cref="OnceAtStartupSchedule"/>, or an error message.
/// </returns>
public static Result<OnceAtStartupSchedule> Create()
{
return new OnceAtStartupSchedule();
}
/// <summary>
/// Calculates the delay until the next execution of the scheduled job, relative to <paramref name="utcNow"/>.
/// </summary>
/// <param name="utcNow">The current UTC date and time.</param>
/// <param name="timeZone">The time zone in which the daily hour and minute of the schedule are expressed.</param>
/// <returns>The delay until the next execution of the scheduled job.</returns>
/// <remarks>
/// A once at startup schedule has no further execution after the one fired at the application startup, so the scheduler
/// never calls this method for it; a maximum delay is returned so that the contract stays total.
/// </remarks>
public override TimeSpan GetDelayUntilNextExecution(DateTime utcNow, TimeZoneInfo timeZone)
{
return TimeSpan.MaxValue;
}
/// <summary>
/// Gets the list of items that define equality of the object.
/// </summary>
/// <returns>A list of items defining the equality.</returns>
public override IEnumerable<object> GetEqualityComponents()
{
yield break;
}
}
@@ -1,6 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Models.Core;
using Lumina.Domain.Common.Primitives;
using Lumina.Domain.SharedKernel.Common.Enums.Scheduling;
using System;
#endregion
@@ -8,7 +7,7 @@ using System;
namespace Lumina.Domain.Core.BoundedContexts.SchedulingBoundedContext.ScheduledJobAggregate.ValueObjects;
/// <summary>
/// Represents an abstract schedule for a scheduled job.
/// Value Object for the abstract schedule for a scheduled job.
/// </summary>
public abstract class Schedule : ValueObject
{
@@ -8,7 +8,7 @@ using System.Diagnostics;
namespace Lumina.Domain.Core.BoundedContexts.SchedulingBoundedContext.ScheduledJobAggregate.ValueObjects;
/// <summary>
/// Value object for the Id of a scheduled job.
/// Value Object for the Id of a scheduled job.
/// </summary>
[DebuggerDisplay("{Value}")]
public sealed class ScheduledJobId : EntityId<Guid>