feat: protect owner-only supply aggregates and record target CAE blocker
This commit is contained in:
@@ -162,7 +162,7 @@ final class InvestorPath
|
||||
}
|
||||
|
||||
$preparationTaskKeys = $opportunity !== null && ($owner || $manager) && app(PrivateInvestmentPreparation::class)->available() ? app(InvestmentPreparationWorkspace::class)->taskKeys($actor, $id, $opportunity) : null;
|
||||
$supplyEnabled = (int) $case->user_id === $actor->id && config('investor-path.aggregate_supply_qa_enabled') && \App\Support\IsolatedQaDatabase::allowsSchemaChanges();
|
||||
$supplyEnabled = (int) $case->user_id === $actor->id && app(ProactiveSupply::class)->aggregateAvailable();
|
||||
|
||||
return ['funding_selections' => ($owner || $manager) ? array_values(array_filter($path['funding_selections'] ?? [], fn ($row) => ($row['opportunity'] ?? null) === $opportunity)) : [], 'preparation_action' => ($owner || $manager) && app(PrivateInvestmentPreparation::class)->available() ? app(InvestmentPreparationWorkspace::class)->continuation($actor, $id, $opportunity, request()->query('swot_action')) : null, 'private_investment' => $preparation, 'case' => ['id' => $id, 'title' => $case->title, 'version' => $case->version, 'closed' => $case->closed_at !== null],
|
||||
'journey_id' => $journey->id, 'definition_id' => $version->id, 'definition_version' => $version->version_no, 'source_sha256' => $definition['source_sha256'],
|
||||
@@ -174,7 +174,9 @@ final class InvestorPath
|
||||
'investment_context' => ($owner || $manager) ? [...$context, 'opportunity_choices' => $opportunity ? $context['opportunity_choices'] : $allChoices] : null,
|
||||
'can_set_promoter' => (int) $case->user_id === $actor->id && $case->organization_id === null && ! $case->closed_at,
|
||||
'results' => $results, 'requests' => $requests, 'documents' => $documents,
|
||||
'supply_aggregate_enabled' => $supplyEnabled, 'supply_aggregates' => $supplyEnabled ? ($path['supply_aggregates'] ?? []) : [],
|
||||
'supply_aggregate_enabled' => $supplyEnabled, 'supply_aggregate_protected' => $supplyEnabled && (bool) config('investor-path.protected_supply_enabled'),
|
||||
'supply_activity_options' => $supplyEnabled && config('investor-path.protected_supply_enabled') ? app(ProactiveSupply::class)->aggregateActivityOptions(isset($context['fields']['sector_id']) ? (int) $context['fields']['sector_id'] : null) : [],
|
||||
'supply_aggregates' => $supplyEnabled ? (config('investor-path.protected_supply_enabled') ? app(ProactiveSupply::class)->protectedHistory($path['supply_aggregates'] ?? []) : ($path['supply_aggregates'] ?? [])) : [],
|
||||
'fiscal_reports' => (int) $case->user_id === $actor->id && (count($allChoices) < 2 || $opportunity !== null)
|
||||
? app(SimulationFormDrafts::class)->dossierReportSources($actor, $id, $opportunity) : [],
|
||||
'land_report' => $landCase ? ['id' => $landCase->id, 'version' => $landCase->version, 'updated_at' => $landCase->updated_at?->toIso8601String(),
|
||||
|
||||
Reference in New Issue
Block a user