Files
DocumentService/DocumentOperator.Application/Common/DTOs/AttachmentMetadata.cs
TekH 0e88b349d7 Rebrand project: DocumentOperator to DocumentService
This commit implements a complete rebranding of the project:
- Updated all namespaces from `DocumentOperator` to `DocumentService`.
- Renamed file paths, embedded resources, and test data references.
- Updated configuration keys, logging paths, and Redis instance names.
- Revised documentation to reflect the new project name.
- Modified project and solution files to align with the new structure.
- Updated class names, DTOs, commands, queries, and handlers.
- Adjusted middleware, controllers, and API endpoints.
- Updated Swagger metadata and API titles to `DocumentService API`.
- Refactored test namespaces, resource paths, and embedded resources.
- Updated build and deployment configurations for the new name.
- Replaced all references to `DocumentOperator` in comments and literals.

These changes ensure consistency across the codebase and documentation.
2026-07-30 14:02:56 +02:00

45 lines
1.5 KiB
C#

namespace DocumentService.Application.Common.DTOs;
/// <summary>
/// Represents metadata of a single PDF attachment (embedded file).
/// Immutable value object containing file information without the actual binary data.
/// </summary>
/// <remarks>
/// Initializes a new instance of the AttachmentMetadata class.
/// </remarks>
/// <param name="fileName">Attachment file name</param>
/// <param name="mimeType">MIME type (e.g., "text/xml")</param>
/// <param name="sizeBytes">File size in bytes</param>
public sealed class AttachmentMetadata(string fileName, string mimeType, long sizeBytes)
{
/// <summary>
/// Gets the attachment file name (e.g., "invoice.xml", "document.pdf")
/// </summary>
public string FileName { get; } = fileName ?? string.Empty;
/// <summary>
/// Gets the MIME type of the attachment (e.g., "text/xml", "application/pdf")
/// </summary>
public string MimeType { get; } = mimeType ?? "application/octet-stream"; // Default MIME type if unknown
/// <summary>
/// Gets the attachment file size in bytes
/// </summary>
public long SizeBytes { get; } = sizeBytes;
/// <summary>
/// Gets the attachment file size in kilobytes (computed property)
/// </summary>
public double SizeKB => SizeBytes / 1024.0;
/// <summary>
/// Gets the attachment file size in megabytes (computed property)
/// </summary>
public double SizeMB => SizeBytes / 1024.0 / 1024.0;
public override string ToString()
{
return $"{FileName} ({MimeType}, {SizeKB:F2} KB)";
}
}