Refactor: Replace EmailAccountDto with EmailAccount

Replaced the `EmailAccountDto` class with the `EmailAccount` class across the codebase to consolidate the `EmailAccount` entity into the domain layer. Updated namespaces, method signatures, property types, and test cases to reflect this change.

Moved `EmailAccount` from `DigitalData.MessagingService.Application.Common.Dto` to `DigitalData.MessagingService.Domain.Entities`. Updated XML documentation and removed redundant project file entries. Adjusted namespaces for related queries, validators, and commands to align with the new structure.

These changes improve separation of concerns and align with domain-driven design principles.
This commit is contained in:
2026-08-12 15:26:15 +02:00
parent 91581649ba
commit b2857c558f
15 changed files with 41 additions and 37 deletions

View File

@@ -0,0 +1,52 @@
namespace DigitalData.MessagingService.Domain.Entities;
/// <summary>
/// DTO for a single email account configuration.
/// </summary>
public class EmailAccount
{
/// <summary>
/// Logical name to identify this account (e.g. "default", "support").
/// </summary>
public int Id { get; set; }
#if NET
public required string Username { get; set; }
#else
public string Username { get; set; } = null!;
#endif
#if NET
public required string Password { get; set; }
#else
public string Password { get; set; } = null!;
#endif
#if NET
public required string SmtpServer { get; set; }
#else
public string SmtpServer { get; set; } = null!;
#endif
public int SmtpPort { get; set; }
public bool SmtpUseSsl { get; set; }
public bool UseOAuth2 { get; set; }
/// <summary>
/// IMAP server hostname (e.g. "imap.example.com").
/// Leave empty when this account is send-only.
/// </summary>
public string? ImapServer { get; set; }
/// <summary>
/// IMAP server port (993 for SSL, 143 for plain/STARTTLS).
/// </summary>
public int ImapPort { get; set; } = 993;
/// <summary>
/// Use SSL/TLS when connecting to the IMAP server.
/// </summary>
public bool ImapUseSsl { get; set; } = true;
}