Completed initial database design
continuous-integration/drone/pr Build is passing

Sealed qualifying public classes
Migrated database changes
This commit is contained in:
Khwezi Mngoma
2026-05-27 09:12:04 +02:00
parent 70860efcfb
commit 902942eee6
86 changed files with 2883 additions and 140 deletions
@@ -3,7 +3,7 @@ using LiteCharms.Features.Quartz.Abstractions;
namespace LiteCharms.Features.Quartz;
public class JobOrchestrator(ISchedulerFactory schedulerFactory) : IJobOrchestrator
public sealed class JobOrchestrator(ISchedulerFactory schedulerFactory) : IJobOrchestrator
{
public async Task SendAsync<TNotification>(TNotification notification, CancellationToken cancellationToken = default)
where TNotification : IEvent
@@ -11,7 +11,7 @@ public class JobOrchestrator(ISchedulerFactory schedulerFactory) : IJobOrchestra
var chainedJobGroup = "onetime-jobs";
var scheduler = await schedulerFactory.GetScheduler(cancellationToken);
var jobKey = new JobKey($"{notification.Name.ToLower()}-{notification.CorrelationId.ToLower()}", chainedJobGroup);
var jobKey = new JobKey($"{notification.Name.ToLower(CultureInfo.InvariantCulture)}-{notification.CorrelationId.ToLower(CultureInfo.InvariantCulture)}", chainedJobGroup);
var triggerKey = new TriggerKey($"{jobKey.Name}-trigger", chainedJobGroup);
var job = JobBuilder.Create<MediatorJob<TNotification>>()
@@ -35,7 +35,7 @@ public class JobOrchestrator(ISchedulerFactory schedulerFactory) : IJobOrchestra
var chainedJobGroup = "scheduled-jobs";
var scheduler = await schedulerFactory.GetScheduler(cancellationToken);
var jobKey = new JobKey($"{notification.Name.ToLower()}", chainedJobGroup);
var jobKey = new JobKey($"{notification.Name.ToLower(CultureInfo.InvariantCulture)}", chainedJobGroup);
var triggerKey = new TriggerKey($"{jobKey.Name}-trigger", chainedJobGroup);
var job = JobBuilder.Create<MediatorJob<TNotification>>()
@@ -53,7 +53,7 @@ public class JobOrchestrator(ISchedulerFactory schedulerFactory) : IJobOrchestra
.WithDescription($"Scheduled via Main Job at {now:g}")
.WithCronSchedule(cronExpression, cron => cron
.WithMisfireHandlingInstructionIgnoreMisfires())
.StartAt(now)
.StartAt((DateTimeOffset)now)
.Build();
await scheduler.AddJob(job, replace: true, cancellationToken);
+1 -1
View File
@@ -4,7 +4,7 @@ using LiteCharms.Features.Mediator;
namespace LiteCharms.Features.Quartz;
[DisallowConcurrentExecution]
public class MediatorJob<TNotification>(IMediator mediator) : IJob where TNotification : IEvent
public sealed class MediatorJob<TNotification>(IMediator mediator) : IJob where TNotification : IEvent
{
public async Task Execute(IJobExecutionContext context)
{
@@ -1,6 +1,6 @@
namespace LiteCharms.Features.Quartz;
public class RetryJobListener : IJobListener
public sealed class RetryJobListener : IJobListener
{
public string Name => "RetryJobListener";