diff --git a/api-v3/src/inspection-closing/inspection-closing.service.ts b/api-v3/src/inspection-closing/inspection-closing.service.ts index 8953f74..253a4e4 100644 --- a/api-v3/src/inspection-closing/inspection-closing.service.ts +++ b/api-v3/src/inspection-closing/inspection-closing.service.ts @@ -277,7 +277,6 @@ export class InspectionClosingService { this.assertDraftInProgress(act, visit); await this.assertActorAssigned(manager, visit.id, principal, true); await this.requireResponsible(manager, actId); - await this.assertVerificationResultsComplete(manager, visit.id); if (await this.signatureCount(manager, actId)) { throw new ConflictException({ code: 'INSPECTION_ACT_ALREADY_SIGNED', @@ -935,22 +934,6 @@ export class InspectionClosingService { }; } - private async assertVerificationResultsComplete(manager: EntityManager, inspectionId: string): Promise { - const [row] = await manager.query(` - SELECT - COUNT(*)::integer AS total, - COUNT(*) FILTER (WHERE outcome IS NOT NULL)::integer AS completed - FROM inspection_finding_verification_visits - WHERE visit_id=$1 - `, [inspectionId]) as Array<{ total: number; completed: number }>; - if (Number(row?.total ?? 0) > 0 && Number(row.completed) !== Number(row.total)) { - throw new ConflictException({ - code: 'INSPECTION_VERIFICATION_RESULTS_REQUIRED', - message: 'Registrá el resultado de todas las verificaciones antes de finalizar el acta', - }); - } - } - private async deadlinePolicy(manager: EntityManager): Promise { const [row] = await manager.query(` SELECT