Files
Services.DDDocumentOperator/DocumentOperator.Domain/Models/ValueObjects/PdfMetadata.cs
OlgunR 3a87ace144 Complete Phase 2: Domain Layer implementation
Updated ROADMAP.md to mark Phase 2 as completed and added detailed descriptions of completed tasks. Introduced three new value objects (`Base64String`, `TenantId`, and `PdfMetadata`) in the `DocumentOperator.Domain.Models.ValueObjects` namespace. These classes ensure type safety, immutability, and encapsulated validation.

- `Base64String`: Handles Base64 string creation, validation, and conversion.
- `TenantId`: Represents a tenant identifier with validation and normalization.
- `PdfMetadata`: Represents PDF metadata with computed properties.

Updated `DocumentOperator.Domain.csproj` to reflect the addition of these value objects. The project is now ready to begin Phase 3 (Infrastructure Layer).
2026-06-18 14:32:06 +02:00

32 lines
933 B
C#

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}";
}
}