Ensured UTC is used

This commit is contained in:
Khwezi Mngoma
2026-05-15 08:37:58 +02:00
parent 4523ef6151
commit 65687d231e
9 changed files with 24 additions and 24 deletions
@@ -1,7 +1,6 @@
using LiteCharms.Features.Email;
using LiteCharms.Features.Shop.Notifications.Entities;
using LiteCharms.Features.Shop.Notifications.Models;
using LiteCharms.Features.Shop.Postgres;
using static LiteCharms.Features.Extensions.Timezones;
namespace LiteCharms.Features.Shop.Notifications.Events.Handlers;
@@ -17,8 +16,8 @@ public class ProcessEmailNotificationsEventHandler(IDbContextFactory<ShopDbConte
using var context = await contextFactory.CreateDbContextAsync(cancellationToken);
var notifications = await context.Notifications
.OrderByDescending(o => o.Priority)
.ThenBy(o => o.CreatedAt)
.OrderByDescending(o => o.CreatedAt)
.ThenBy(o => o.Priority)
.Where(n => n.CorrelationIdType == CorrelationIdTypes.Email)
.Where(n => n.Direction == NotificationDirection.Outgoing)
.Take(message.MaxRecords)
@@ -44,7 +43,7 @@ public class ProcessEmailNotificationsEventHandler(IDbContextFactory<ShopDbConte
}
notification.Processed = true;
notification.UpdatedAt = SouthAfricanTimeZone.UtcNow();
notification.UpdatedAt = DateTime.UtcNow;
}
await context.SaveChangesAsync(cancellationToken);