using Books.Api.Domain.Attachments; using EventFlow.Commands; namespace Books.Api.Commands.Attachments; /// /// Command to upload an attachment (bilag). /// Required by Bogføringsloven § 6 for document retention. /// public class UploadAttachmentCommand( AttachmentId aggregateId, string companyId, string fileName, string originalFileName, string contentType, long fileSize, string storagePath, string uploadedBy, string? draftId = null, string? transactionId = null) : Command(aggregateId) { public string CompanyId { get; } = companyId; public string FileName { get; } = fileName; public string OriginalFileName { get; } = originalFileName; public string ContentType { get; } = contentType; public long FileSize { get; } = fileSize; public string StoragePath { get; } = storagePath; public string UploadedBy { get; } = uploadedBy; public string? DraftId { get; } = draftId; public string? TransactionId { get; } = transactionId; } /// /// Command to link an attachment to a posted transaction. /// public class LinkAttachmentToTransactionCommand( AttachmentId aggregateId, string transactionId) : Command(aggregateId) { public string TransactionId { get; } = transactionId; } /// /// Command to delete an attachment. /// Note: Per Bogføringsloven § 6, this should only be used after /// the 5-year retention period. /// public class DeleteAttachmentCommand( AttachmentId aggregateId, string deletedBy, string reason) : Command(aggregateId) { public string DeletedBy { get; } = deletedBy; public string Reason { get; } = reason; }