Entrega dashboard e correccoes transversais preservando Ofertas instalado
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-15 18:56:39 +02:00
parent 1349789226
commit fb076c174f
117 changed files with 10380 additions and 1905 deletions
+8 -3
View File
@@ -66,11 +66,16 @@ final class InvestmentCorridorContext
*/
public function parks(?string $key, ?string $territory): array
{
if (! $key || ! $territory) {
if (! $territory) {
return [];
}
abort_unless($this->compatible($key, $territory), 422, 'A localização não pertence ao corredor escolhido.');
if ($key) {
abort_unless($this->compatible($key, $territory), 422, 'A localização não pertence ao corredor escolhido.');
}
$selectedPath = array_column(app(InvestmentGeography::class)->path($territory), 'id');
if ($selectedPath === []) {
return [];
}
$candidates = app(InvestmentZones::class)->visible()->whereIn('category', ['industrial_park', 'zee', 'zfi'])->orderBy('name')->get();
$result = [];
foreach ($candidates as $zone) {
@@ -83,7 +88,7 @@ final class InvestmentCorridorContext
}
foreach ($ids as $link) {
$id = $link->geo_location_id;
if (! $this->compatible($key, $id)) {
if ($key && ! $this->compatible($key, $id)) {
continue;
}
$path = array_column(app(InvestmentGeography::class)->path($id), 'id');