feat(editorial): separate cluster analysis approval and publication in QA

This commit is contained in:
2026-11-13 23:08:02 +02:00
parent b3849d850e
commit 1218734eca
16 changed files with 658 additions and 46 deletions
@@ -31,8 +31,17 @@ class InvestmentStructureController extends Controller
});
}
return Inertia::render('structures/index', ['structure' => $structure, 'filters' => $filters,
'records' => $query->orderBy('name')->orderBy('id')->paginate(20)->withQueryString()]);
$records = $query->orderBy('name')->orderBy('id')->paginate(20)->withQueryString();
if ($structure === 'clusters' && app(ClusterCompetitiveness::class)->editorialEnabled()) {
$records->through(function ($record) {
$analysis = app(ClusterCompetitiveness::class)->current($record->id);
$record->setAttribute('editorial_state', $analysis['workflow']['state'] ?? ($analysis['approved'] ? 'legacy_published' : 'not_started'));
return $record;
});
}
return Inertia::render('structures/index', ['structure' => $structure, 'filters' => $filters, 'records' => $records]);
}
public function edit(Request $request, string $structure, ?string $id = null): Response