feat: add source attachment details as notes to processed documents
Build and Push Multi-Platform Images / build-and-push (push) Successful in 30s

This commit is contained in:
2026-05-09 14:06:04 +02:00
parent 0318fe8e7a
commit 5c8a71bdda
@@ -299,6 +299,19 @@ export class PaperlessTaskProcessorService {
// Add Notes
this.logger.log(`[Postprocessing] Task ${t.TaskId} - Füge Notizen hinzu`);
await this.paperlessService.addNote(document.id, `Task bearbeitet: ${new Date().toLocaleString('de-DE')}`);
if (t.SourceAttachmentID) {
const attachment = await this.attachmentRepo.findOne({ where: { Id: t.SourceAttachmentID }, relations: ['EmailMessage'] });
if (attachment) {
const rangePart = t.SourceAttachmentRange && t.SourceAttachmentRange !== 'full'
? ` | Seiten: ${t.SourceAttachmentRange}`
: '';
const messageId = attachment.EmailMessage?.MessageId ?? String(attachment.EmailMessageId);
await this.paperlessService.addNote(document.id, `E-Mail-ID: ${messageId} | Datei: ${attachment.FileName}${rangePart}`);
this.logger.log(`[Postprocessing] Task ${t.TaskId} - Herkunfts-Notiz hinzugefügt`);
}
}
if (t.BarcodeJson) {
await this.paperlessService.addNote(document.id, t.BarcodeJson);
this.logger.log(`[Postprocessing] Task ${t.TaskId} - BarcodeJson-Notiz hinzugefügt`);