feat: add source attachment details as notes to processed documents
Build and Push Multi-Platform Images / build-and-push (push) Successful in 30s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 30s
This commit is contained in:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user