refactor(application): Reorganize DTOs - flatten single-DTO folders
- Move EmailAccountDto.cs to Dtos/ (was in EmailAccounts/ subfolder) - Move EmailProfileDto.cs to Dtos/ (was in EmailProfiles/ subfolder) - Keep EmailAttachments/ (3 DTOs) and EmailHistories/ (3 DTOs) subfolders - Update all namespace imports from Dtos.EmailAccounts/EmailProfiles to Dtos - Simpler structure: single DTOs at root, multiple DTOs in subfolders
This commit is contained in:
@@ -1,54 +0,0 @@
|
|||||||
namespace DigitalData.EmailProfiler.Application.Common.Dtos;
|
|
||||||
|
|
||||||
public class EmailProfileDto
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public string ProfileName { get; set; } = string.Empty;
|
|
||||||
public int EmailAccountId { get; set; }
|
|
||||||
public string? EmailAccountName { get; set; }
|
|
||||||
public int? ProcessId { get; set; }
|
|
||||||
public string? ProcessName { get; set; }
|
|
||||||
public int PollIntervalMinutes { get; set; }
|
|
||||||
public DateTime? LastPollTime { get; set; }
|
|
||||||
public bool IsActive { get; set; }
|
|
||||||
public string? Comment { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EmailAccountDto
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public string AccountName { get; set; } = string.Empty;
|
|
||||||
public string ImapServer { get; set; } = string.Empty;
|
|
||||||
public int ImapPort { get; set; }
|
|
||||||
public string SmtpServer { get; set; } = string.Empty;
|
|
||||||
public int SmtpPort { get; set; }
|
|
||||||
public string Username { get; set; } = string.Empty;
|
|
||||||
public bool UseOAuth2 { get; set; }
|
|
||||||
public bool IsActive { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EmailHistoryDto
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public int? ProfileId { get; set; }
|
|
||||||
public string? ProfileName { get; set; }
|
|
||||||
public string? SenderAddress { get; set; }
|
|
||||||
public string? Subject { get; set; }
|
|
||||||
public DateTime? EmailDate { get; set; }
|
|
||||||
public DateTime? ProcessedDate { get; set; }
|
|
||||||
public string? Status { get; set; }
|
|
||||||
public int? ErrorCodeValue { get; set; }
|
|
||||||
public string? ErrorMessage { get; set; }
|
|
||||||
public List<EmailAttachmentDto> Attachments { get; set; } = new();
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EmailAttachmentDto
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
public string OriginalFileName { get; set; } = string.Empty;
|
|
||||||
public string FilePath { get; set; } = string.Empty;
|
|
||||||
public long FileSize { get; set; }
|
|
||||||
public bool IsEmbeddedFile { get; set; }
|
|
||||||
public string? Status { get; set; }
|
|
||||||
public string? ValidationErrorMessage { get; set; }
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Application.Common.Dtos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO for EmailAccount query results.
|
||||||
|
/// </summary>
|
||||||
|
public class EmailAccountDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string AccountName { get; set; } = string.Empty;
|
||||||
|
public string ImapServer { get; set; } = string.Empty;
|
||||||
|
public int ImapPort { get; set; }
|
||||||
|
public string SmtpServer { get; set; } = string.Empty;
|
||||||
|
public int SmtpPort { get; set; }
|
||||||
|
public string Username { get; set; } = string.Empty;
|
||||||
|
public bool UseOAuth2 { get; set; }
|
||||||
|
public bool IsActive { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Application.Common.Dtos.EmailAttachments;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO for creating EmailAttachment record.
|
||||||
|
/// AutoMapper profile required: CreateEmailAttachmentDto -> EmailAttachment
|
||||||
|
/// </summary>
|
||||||
|
public record CreateEmailAttachmentDto(
|
||||||
|
int EmailHistoryId,
|
||||||
|
string OriginalFileName,
|
||||||
|
string SavedFileName,
|
||||||
|
string FilePath,
|
||||||
|
long FileSize,
|
||||||
|
string Extension,
|
||||||
|
string ContentType,
|
||||||
|
byte[] Content);
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Application.Common.Dtos.EmailAttachments;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO for EmailAttachment query results.
|
||||||
|
/// </summary>
|
||||||
|
public class EmailAttachmentDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string OriginalFileName { get; set; } = string.Empty;
|
||||||
|
public string FilePath { get; set; } = string.Empty;
|
||||||
|
public long FileSize { get; set; }
|
||||||
|
public bool IsEmbeddedFile { get; set; }
|
||||||
|
public string? Status { get; set; }
|
||||||
|
public string? ValidationErrorMessage { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Application.Common.Dtos.EmailAttachments;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO for updating EmailAttachment status.
|
||||||
|
/// AutoMapper profile required: UpdateEmailAttachmentStatusDto -> EmailAttachment
|
||||||
|
/// </summary>
|
||||||
|
public record UpdateEmailAttachmentStatusDto(
|
||||||
|
string Status,
|
||||||
|
int? ValidationErrorCode = null,
|
||||||
|
string? ValidationErrorMessage = null);
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Application.Common.Dtos.EmailHistories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO for creating EmailHistory record.
|
||||||
|
/// AutoMapper profile required: CreateEmailHistoryDto -> EmailHistory
|
||||||
|
/// </summary>
|
||||||
|
public record CreateEmailHistoryDto(
|
||||||
|
int ProfileId,
|
||||||
|
string MessageIdHash,
|
||||||
|
string OriginalMessageId,
|
||||||
|
string SenderAddress,
|
||||||
|
DateTime EmailDate,
|
||||||
|
string Subject,
|
||||||
|
string? EmailBodyText,
|
||||||
|
string? EmailBodyHtml);
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using DigitalData.EmailProfiler.Application.Common.Dtos.EmailAttachments;
|
||||||
|
|
||||||
|
namespace DigitalData.EmailProfiler.Application.Common.Dtos.EmailHistories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO for EmailHistory query results.
|
||||||
|
/// </summary>
|
||||||
|
public class EmailHistoryDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public int? ProfileId { get; set; }
|
||||||
|
public string? ProfileName { get; set; }
|
||||||
|
public string? SenderAddress { get; set; }
|
||||||
|
public string? Subject { get; set; }
|
||||||
|
public DateTime? EmailDate { get; set; }
|
||||||
|
public DateTime? ProcessedDate { get; set; }
|
||||||
|
public string? Status { get; set; }
|
||||||
|
public int? ErrorCodeValue { get; set; }
|
||||||
|
public string? ErrorMessage { get; set; }
|
||||||
|
public List<EmailAttachmentDto> Attachments { get; set; } = new();
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Application.Common.Dtos.EmailHistories;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO for updating EmailHistory status.
|
||||||
|
/// AutoMapper profile required: UpdateEmailHistoryStatusDto -> EmailHistory
|
||||||
|
/// </summary>
|
||||||
|
public record UpdateEmailHistoryStatusDto(
|
||||||
|
string Status,
|
||||||
|
DateTime? ProcessedDate = null,
|
||||||
|
int? ErrorCodeValue = null,
|
||||||
|
string? ErrorMessage = null);
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace DigitalData.EmailProfiler.Application.Common.Dtos;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO for EmailProfile query results.
|
||||||
|
/// </summary>
|
||||||
|
public class EmailProfileDto
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string ProfileName { get; set; } = string.Empty;
|
||||||
|
public int EmailAccountId { get; set; }
|
||||||
|
public string? EmailAccountName { get; set; }
|
||||||
|
public int? ProcessId { get; set; }
|
||||||
|
public string? ProcessName { get; set; }
|
||||||
|
public int PollIntervalMinutes { get; set; }
|
||||||
|
public DateTime? LastPollTime { get; set; }
|
||||||
|
public bool IsActive { get; set; }
|
||||||
|
public string? Comment { get; set; }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user