Replaced `DigitalData.MessagingService.Abstraction` with `DigitalData.MessagingService.Application.Common.Dto` and `DigitalData.MessagingService.Application.Common.Dto.MailSearch` to improve modularity and organization. Removed the `Abstraction` project and updated all references to use the `Application` project. Updated namespaces, `using` directives, and dependencies across the codebase. Refactored interfaces, commands, queries, validators, and services to use the new DTOs. Updated RabbitMQ integration, AutoMapper profiles, background services, and tests to align with the new structure. Performed general cleanup by removing redundant `using` directives and obsolete references.
98 lines
2.3 KiB
C#
98 lines
2.3 KiB
C#
namespace DigitalData.MessagingService.Application.Common.Dto;
|
|
|
|
/// <summary>
|
|
/// Represents an email message received via IMAP.
|
|
/// </summary>
|
|
public sealed record ReceivedEmailDto
|
|
{
|
|
/// <summary>
|
|
/// Unique identifier of the message on the IMAP server (UID).
|
|
/// </summary>
|
|
#if NET
|
|
public long Uid { get; init; }
|
|
#else
|
|
public long Uid { get; set; }
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Sender address (From header).
|
|
/// </summary>
|
|
#if NET
|
|
public string From { get; init; } = string.Empty;
|
|
#else
|
|
public string From { get; set; } = string.Empty;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Recipient addresses (To header).
|
|
/// </summary>
|
|
#if NET
|
|
public IEnumerable<string> To { get; init; } = [];
|
|
#else
|
|
public IEnumerable<string> To { get; set; } = [];
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// CC addresses.
|
|
/// </summary>
|
|
#if NET
|
|
public IEnumerable<string> Cc { get; init; } = [];
|
|
#else
|
|
public IEnumerable<string> Cc { get; set; } = [];
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Email subject.
|
|
/// </summary>
|
|
#if NET
|
|
public string Subject { get; init; } = string.Empty;
|
|
#else
|
|
public string Subject { get; set; } = string.Empty;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Plain-text body (may be empty when only HTML is present).
|
|
/// </summary>
|
|
#if NET
|
|
public string TextBody { get; init; } = string.Empty;
|
|
#else
|
|
public string TextBody { get; set; } = string.Empty;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// HTML body (may be empty when only plain-text is present).
|
|
/// </summary>
|
|
#if NET
|
|
public string HtmlBody { get; init; } = string.Empty;
|
|
#else
|
|
public string HtmlBody { get; set; } = string.Empty;
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Date/time the message was sent (Date header).
|
|
/// </summary>
|
|
#if NET
|
|
public DateTime Date { get; init; }
|
|
#else
|
|
public DateTime Date { get; set; }
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Attachments included with this message.
|
|
/// </summary>
|
|
#if NET
|
|
public IEnumerable<EmailAttachmentDto> Attachments { get; init; } = [];
|
|
#else
|
|
public IEnumerable<EmailAttachmentDto> Attachments { get; set; } = [];
|
|
#endif
|
|
|
|
/// <summary>
|
|
/// Whether the message has been marked as seen/read on the server.
|
|
/// </summary>
|
|
#if NET
|
|
public bool IsSeen { get; init; }
|
|
#else
|
|
public bool IsSeen { get; set; }
|
|
#endif
|
|
}
|