fix(api): scope checklist by Yacimiento ancestry
This commit is contained in:
@@ -151,7 +151,6 @@ export class InspectionPlanningCreateService {
|
||||
FROM inspection_findings finding
|
||||
INNER JOIN assets inventory ON inventory.id=finding.asset_id
|
||||
WHERE inventory.operational_area_id=$2::uuid
|
||||
AND inventory.operator_company_id=$5::uuid
|
||||
AND finding.status<>'VOIDED'
|
||||
AND EXISTS (
|
||||
WITH RECURSIVE ancestors AS (
|
||||
@@ -164,7 +163,7 @@ export class InspectionPlanningCreateService {
|
||||
SELECT 1 FROM ancestors WHERE id=$3::uuid LIMIT 1
|
||||
)
|
||||
ORDER BY finding.created_at,finding.id
|
||||
`, [visit.id, dto.operationalAreaId, scopeAssetId, plannedStartAt.toISOString().slice(0, 10), dto.operatorCompanyId]);
|
||||
`, [visit.id, dto.operationalAreaId, scopeAssetId, plannedStartAt.toISOString().slice(0, 10)]);
|
||||
|
||||
stage = 'checklist:assets';
|
||||
await manager.query(`
|
||||
|
||||
Reference in New Issue
Block a user