refactor: Move DTOs from Domain to Application layer
- Move PdfMetadata, PdfAMetadata from Domain.Models.ValueObjects to Application.Common.DTOs - Move AttachmentInfo, AttachmentMetadata from Domain.Models.ValueObjects to Application.Common.DTOs - Reason: DTOs belong in Application layer, Domain should have zero external dependencies (Clean Architecture)
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
namespace DocumentOperator.Domain.Models.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// PDF/A validation metadata including conformance level and validation errors/warnings
|
||||
/// </summary>
|
||||
public sealed class PdfAMetadata
|
||||
{
|
||||
public bool IsValid { get; }
|
||||
public string PdfVersion { get; }
|
||||
public int PageCount { get; }
|
||||
public long FileSizeBytes { get; }
|
||||
public bool Encrypted { get; }
|
||||
public string? PdfAVersion { get; }
|
||||
public bool PdfACompliant { get; }
|
||||
public IReadOnlyList<string> Errors { get; }
|
||||
public IReadOnlyList<string> Warnings { get; }
|
||||
|
||||
// Computed property
|
||||
public double FileSizeMB => FileSizeBytes / 1024.0 / 1024.0;
|
||||
|
||||
public PdfAMetadata(
|
||||
bool isValid,
|
||||
string pdfVersion,
|
||||
int pageCount,
|
||||
long fileSizeBytes,
|
||||
bool encrypted,
|
||||
string? pdfaVersion,
|
||||
bool pdfaCompliant,
|
||||
IReadOnlyList<string> errors,
|
||||
IReadOnlyList<string> warnings)
|
||||
{
|
||||
IsValid = isValid;
|
||||
PdfVersion = pdfVersion;
|
||||
PageCount = pageCount;
|
||||
FileSizeBytes = fileSizeBytes;
|
||||
Encrypted = encrypted;
|
||||
PdfAVersion = pdfaVersion;
|
||||
PdfACompliant = pdfaCompliant;
|
||||
Errors = errors;
|
||||
Warnings = warnings;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"PDF/A: {PdfAVersion ?? "None"}, {PageCount} pages, {FileSizeMB:F2} MB, Compliant: {PdfACompliant}";
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace DocumentOperator.Domain.Models.ValueObjects;
|
||||
|
||||
public sealed class PdfMetadata
|
||||
{
|
||||
public int PageCount { get; }
|
||||
public long FileSizeBytes { get; }
|
||||
public string PdfVersion { get; }
|
||||
public bool HasAttachments { get; }
|
||||
public int AttachmentCount { get; }
|
||||
|
||||
// Computed Property (berechnet aus FileSizeBytes)
|
||||
public double FileSizeMB => FileSizeBytes / 1024.0 / 1024.0;
|
||||
|
||||
public PdfMetadata(
|
||||
int pageCount,
|
||||
long fileSizeBytes,
|
||||
string pdfVersion,
|
||||
bool hasAttachments,
|
||||
int attachmentCount)
|
||||
{
|
||||
PageCount = pageCount;
|
||||
FileSizeBytes = fileSizeBytes;
|
||||
PdfVersion = pdfVersion;
|
||||
HasAttachments = hasAttachments;
|
||||
AttachmentCount = attachmentCount;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"PDF: {PageCount} pages, {FileSizeMB:F2} MB, Version {PdfVersion}, Attachments: {AttachmentCount}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user