fix(f4): require current checklist before inspection execution
This commit is contained in:
@@ -302,6 +302,12 @@ export class InspectionVisitLifecycleService {
|
|||||||
message: 'Definí Área/Yacimiento, Operadora, Inspector responsable y fecha de inicio antes de planificar',
|
message: 'Definí Área/Yacimiento, Operadora, Inspector responsable y fecha de inicio antes de planificar',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (!visit.checklistGeneratedAt || visit.checklistGeneration < 1) {
|
||||||
|
throw new BadRequestException({
|
||||||
|
code: 'INSPECTION_CHECKLIST_REQUIRED',
|
||||||
|
message: 'Generá el checklist automático antes de confirmar la planificación',
|
||||||
|
});
|
||||||
|
}
|
||||||
const [relation] = await manager.query(`
|
const [relation] = await manager.query(`
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM area_company_relations
|
FROM area_company_relations
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ test('D5.1/F4 applies the mobile-inspector policy to every field operation', asy
|
|||||||
assert.equal(policyCalls(acts), 3);
|
assert.equal(policyCalls(acts), 3);
|
||||||
assert.equal(policyCalls(findings), 2);
|
assert.equal(policyCalls(findings), 2);
|
||||||
assert.equal(policyCalls(evidence), 1);
|
assert.equal(policyCalls(evidence), 1);
|
||||||
assert.equal(policyCalls(closing), 7);
|
assert.equal(policyCalls(closing), 6);
|
||||||
assert.match(evidence, /purpose === InspectionEvidencePurpose\.OBSERVATION/);
|
assert.match(evidence, /purpose === InspectionEvidencePurpose\.OBSERVATION/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user