feat(application): add DTOs and application layer dependencies

DTOs:
- EmailProfileDto: Profile data transfer object
- EmailAccountDto: Email account data transfer object
- EmailHistoryDto: Email history data transfer object
- EmailAttachmentDto: Attachment data transfer object

Dependencies:
- MediatR 14.2.0 for CQRS (Commands/Queries)
- AutoMapper 12.0.1 for entity-DTO mapping
- FluentValidation 12.1.1 for input validation

This provides the foundation for the application layer implementation.
This commit is contained in:
2026-07-07 18:59:31 +02:00
parent 146b56ff85
commit 43101a6e61
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
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; }
}

View File

@@ -10,4 +10,10 @@
<ProjectReference Include="..\DigitalData.EmailProfiler.Domain\DigitalData.EmailProfiler.Domain.csproj" /> <ProjectReference Include="..\DigitalData.EmailProfiler.Domain\DigitalData.EmailProfiler.Domain.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.1.1" />
<PackageReference Include="MediatR" Version="14.2.0" />
</ItemGroup>
</Project> </Project>