Merge branch 'main' into feat/delete-archive

This commit is contained in:
Mythie
2024-11-27 10:57:13 +11:00
82 changed files with 2450 additions and 1820 deletions

View File

@ -57,7 +57,17 @@ export const SEAL_DOCUMENT_JOB_DEFINITION = {
},
},
include: {
documentMeta: true,
Recipient: true,
team: {
select: {
teamGlobalSettings: {
select: {
includeSigningCertificate: true,
},
},
},
},
},
});
@ -117,7 +127,13 @@ export const SEAL_DOCUMENT_JOB_DEFINITION = {
}
const pdfData = await getFile(documentData);
const certificateData = await getCertificatePdf({ documentId }).catch(() => null);
const certificateData =
(document.team?.teamGlobalSettings?.includeSigningCertificate ?? true)
? await getCertificatePdf({
documentId,
language: document.documentMeta?.language,
}).catch(() => null)
: null;
const newDataId = await io.runTask('decorate-and-sign-pdf', async () => {
const pdfDoc = await PDFDocument.load(pdfData);