fix(actas): keep sealed act content findings-only

This commit is contained in:
Maximo
2026-09-15 20:59:59 -03:00
parent ff297c8d93
commit 215f443f71
14 changed files with 82 additions and 72 deletions
@@ -94,12 +94,12 @@ test('F6.9 revision migration archives both first document versions before servi
assert.match(migration, /PRIMARY KEY \(report_id,template_version\)/);
});
test('F6.9 includes field photos from installations without their own findings', async () => {
test('Acta ignores standalone field photos while the technical Informe remains independent', async () => {
const other = await sharp(photo).resize(75).png().toBuffer();
const unlinked = { id: 'photo-other-asset', assetId: 'asset-2', title: 'Otra instalación', sha256: digest(other), buffer: other };
const withUnlinked = await buildInspectionActPdf(sealed, [evidence, unlinked]);
const linkedOnly = await buildInspectionActPdf(sealed, [evidence]);
assert.ok(withUnlinked.buffer.length > linkedOnly.buffer.length + 500);
assert.ok(Math.abs(withUnlinked.buffer.length - linkedOnly.buffer.length) < 500);
const word = buildInspectionReportWord({ code: 'INF-OTHER', title: 'Informe', generatedAt: new Date(),
frozenSha256: 'c'.repeat(64), frozenSnapshot: { sealedAct: sealed }, photos: [evidence, unlinked] });
assert.ok(word.buffer.includes(Buffer.from('OTRAS INSTALACIONES INSPECCIONADAS')));