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:
34
DocumentOperator.Application/Common/DTOs/PdfAMetadata.cs
Normal file
34
DocumentOperator.Application/Common/DTOs/PdfAMetadata.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
namespace DocumentOperator.Application.Common.DTOs;
|
||||
|
||||
/// <summary>
|
||||
/// PDF/A validation metadata including conformance level and validation errors/warnings
|
||||
/// </summary>
|
||||
public sealed class PdfAMetadata(
|
||||
bool isValid,
|
||||
string pdfVersion,
|
||||
int pageCount,
|
||||
long fileSizeBytes,
|
||||
bool encrypted,
|
||||
string? pdfaVersion,
|
||||
bool pdfaCompliant,
|
||||
IReadOnlyList<string> errors,
|
||||
IReadOnlyList<string> warnings)
|
||||
{
|
||||
public bool IsValid { get; } = isValid;
|
||||
public string PdfVersion { get; } = pdfVersion;
|
||||
public int PageCount { get; } = pageCount;
|
||||
public long FileSizeBytes { get; } = fileSizeBytes;
|
||||
public bool Encrypted { get; } = encrypted;
|
||||
public string? PdfAVersion { get; } = pdfaVersion;
|
||||
public bool PdfACompliant { get; } = pdfaCompliant;
|
||||
public IReadOnlyList<string> Errors { get; } = errors;
|
||||
public IReadOnlyList<string> Warnings { get; } = warnings;
|
||||
|
||||
// Computed property
|
||||
public double FileSizeMB => FileSizeBytes / 1024.0 / 1024.0;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"PDF/A: {PdfAVersion ?? "None"}, {PageCount} pages, {FileSizeMB:F2} MB, Compliant: {PdfACompliant}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user