fix: keep private idea preparation valid in complement lookup

This commit is contained in:
2026-10-27 12:01:24 +02:00
parent 403c444a3e
commit 51d536b7ba
2 changed files with 26 additions and 0 deletions
+4
View File
@@ -46,6 +46,10 @@ final class InvestmentComplements
} else {
$reference = app(InvestorContext::class)->reference($origin);
abort_unless($reference['kind'] === 'opportunity', 422);
// The context resolver has already checked the actor's private scope.
// A private preparation is valid dossier input, not a public offer
// from which this public-complement catalogue can infer services.
if (($reference['visibility'] ?? 'public') === 'private') return [];
$principal = Opportunity::published()->findOrFail($reference['id']);
$text = $principal->summary;
$basis = 'Resumo cadastrado da oportunidade '.$principal->reference;