Files
DigitalData.MessagingService/src/DigitalData.EmailProfiler.Domain/Events/EmailProcessedEvent.cs
TekH 111d2bf264 fix(domain): use DateTime.Now instead of DateTime.UtcNow for legacy compatibility
CRITICAL FIX: Replace all DateTime.UtcNow with DateTime.Now throughout the application.

Reason: Legacy VB.NET system uses local server time, and database stores all
timestamps as local time. Using UTC breaks compatibility and causes incorrect
time comparisons.

Changes:
- EmailProcessedEvent: ProcessedDate now uses DateTime.Now
- EmailHistory.MarkAsProcessed(): ProcessedDate now uses DateTime.Now
- EmailHistory.MarkAsFailed(): ProcessedDate now uses DateTime.Now
- EmailProfile.UpdateLastPollTime(): LastPollTime now uses DateTime.Now
- EmailProfile.ShouldPoll(): Poll interval comparison now uses DateTime.Now

Documentation:
- Added critical note to agents.md about DateTime usage
- Includes examples and detailed explanation for future developers

This ensures all date/time operations remain compatible with legacy database.
2026-07-08 10:36:13 +02:00

14 lines
502 B
C#

using MediatR;
using DigitalData.EmailProfiler.Domain.Enums;
namespace DigitalData.EmailProfiler.Domain.Events;
public class EmailProcessedEvent(int emailHistoryId, int profileId, string messageId, EmailStatus status) : INotification
{
public int EmailHistoryId { get; } = emailHistoryId;
public int ProfileId { get; } = profileId;
public string MessageId { get; } = messageId;
public EmailStatus Status { get; } = status;
public DateTime ProcessedDate { get; } = DateTime.Now;
}