test(f4): align legacy contracts with lifecycle model

This commit is contained in:
2026-09-08 14:39:55 -03:00
parent 7b6460dff2
commit 4df8f40dd4
14 changed files with 73 additions and 87 deletions
@@ -11,14 +11,15 @@ test('F3.2/F4 mantiene múltiples Actas con un solo borrador simultáneo por ins
assert.match(migration, /WHERE status = 'DRAFT'/);
});
test('F3.2 permite seleccionar el Acta explícitamente al trabajar Hallazgos desde la APK', () => {
test('F3.2/F4 exige seleccionar el Acta explícitamente al crear Hallazgos desde la APK', () => {
const controller = read('src/inspection-visits/field-findings.controller.ts');
const service = read('src/inspection-visits/field-findings.service.ts');
const dto = read('src/inspection-visits/dto/create-field-finding.dto.ts');
assert.match(controller, /FieldFindingActQueryDto/);
assert.match(controller, /query\.actId/);
assert.match(dto, /actId\?: string/);
assert.match(service, /actSelectionMode: actId \? 'EXPLICIT' : 'LEGACY_SINGLE_DRAFT'/);
assert.match(dto, /actId!: string/);
assert.match(dto, /El Acta es obligatoria/);
assert.match(service, /this\.requireDraftAct\(visitId, dto\.actId\)/);
assert.match(service, /WHERE id=\$1::uuid AND visit_id=\$2::uuid/);
assert.match(service, /FIELD_FINDING_ACT_NOT_DRAFT/);
assert.match(service, /FIELD_FINDING_ASSET_NOT_IN_ACT/);