F1.1 · Inspección multi-Acta y firma diferida

Implementa el nuevo núcleo operativo: múltiples Actas por Inspección, un Informe por Acta, cierre de campo independiente y firma de empresa diferida con conformidad/disidencia.
This commit is contained in:
2026-09-05 14:46:26 -03:00
committed by GitHub
parent 8e2d0dfe19
commit cd24736df8
34 changed files with 452 additions and 85 deletions
@@ -6,10 +6,10 @@ import test from 'node:test';
const root = process.cwd();
const read = (relative: string) => fs.readFileSync(path.join(root, relative), 'utf8');
test('D5.6 preserves one visit one immutable act with a frozen closure snapshot', () => {
test('D5.6 immutable act closure remains intact after the multi-act transition', () => {
const acts = read('src/inspection-acts/inspection-acts.service.ts');
const closing = read('src/inspection-closing/inspection-closing.service.ts');
assert.match(acts, /INSPECTION_VISIT_ACT_ALREADY_EXISTS/);
assert.match(acts, /INSPECTION_VISIT_DRAFT_ACT_ALREADY_EXISTS/);
assert.match(closing, /final_snapshot = \$2/);
assert.match(closing, /final_sha256 = \$3/);
assert.match(closing, /InspectionActVersionEvent\.CLOSED/);
@@ -74,10 +74,8 @@ test('D5.6 preserves auditable document delivery while allowing SMTP to remain p
assert.match(smtp, /MAIL_FROM/);
});
test('D5.6 declares a stable Phase D closure across maintenance hotfixes without introducing another functional migration', () => {
const apiVersion = read('src/version.ts');
assert.match(apiVersion, /API_VERSION = '0\.19\.6(?:-\d+)?'/);
assert.match(apiVersion, /API_PHASE = 'D5\.6(?:\.\d+)?'/);
test('D5.6 remains a historical closure baseline while Phase F introduces an explicit new migration', () => {
const migrations = fs.readdirSync(path.join(root, 'src/database/migrations'));
assert.equal(migrations.some((name) => /phase-d5-6/i.test(name)), false);
assert.equal(migrations.some((name) => /phase-f1-1-multi-act-inspections/i.test(name)), true);
});