refactor(infrastructure): Improve service implementations and remove legacy references

**Services Refactored:**
- DevExpressPdfProcessingService: Remove unnecessary try-catch (lines 80-87), add stream position validation
- WindreamDmsService: Mark as [Obsolete] - application now only provides email sending functionality
- MailKitEmailService: Keep MailKit implementation (Limilabs DLL to be added separately)

**Custom Exceptions Added:**
- AuthenticationFailedException: OAuth2/IMAP/SMTP authentication failures
- DmsNotAvailableException: windream COM unavailable
- InvalidPdfException: Invalid PDF stream
- NotFoundException: Entity not found in Repository operations

**Legacy Cleanup:**
- Remove legacy VB.NET projects from solution (EmailProfiler.Common, EmailProfiler.Service)
- Delete legacy/ folder reference
- Clean solution file structure

**Stream Validation:**
- All PDF processing methods now validate stream position (reset to 0 if needed)
- Add CanSeek validation for stream-based operations

**Build Status:**  Successful (0 errors, 15 warnings - all acceptable)
This commit is contained in:
2026-07-20 16:36:17 +02:00
parent 8f2365d048
commit 751ef87506
25 changed files with 1728 additions and 268 deletions

View File

@@ -0,0 +1,17 @@
namespace DigitalData.EmailProfiler.Domain.Exceptions;
/// <summary>
/// Exception thrown when OAuth2 authentication fails.
/// </summary>
public class AuthenticationFailedException : Exception
{
public AuthenticationFailedException(string message)
: base(message)
{
}
public AuthenticationFailedException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -0,0 +1,22 @@
namespace DigitalData.EmailProfiler.Domain.Exceptions;
/// <summary>
/// Exception thrown when DMS (windream) is not available or not configured properly.
/// </summary>
public class DmsNotAvailableException : Exception
{
public DmsNotAvailableException()
: base("DMS service is not available. windream COM components may not be registered.")
{
}
public DmsNotAvailableException(string message)
: base(message)
{
}
public DmsNotAvailableException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -0,0 +1,17 @@
namespace DigitalData.EmailProfiler.Domain.Exceptions;
/// <summary>
/// Exception thrown when a PDF file is invalid or corrupted.
/// </summary>
public class InvalidPdfException : Exception
{
public InvalidPdfException(string message)
: base(message)
{
}
public InvalidPdfException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -0,0 +1,22 @@
namespace DigitalData.EmailProfiler.Domain.Exceptions;
/// <summary>
/// Exception thrown when a requested entity is not found.
/// </summary>
public class NotFoundException : Exception
{
public NotFoundException(string entityName, object key)
: base($"{entityName} with key '{key}' was not found.")
{
}
public NotFoundException(string message)
: base(message)
{
}
public NotFoundException(string message, Exception innerException)
: base(message, innerException)
{
}
}