vrsao 2
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-08 14:02:01 +02:00
parent bdd766c68a
commit 1106509116
354 changed files with 48275 additions and 24635 deletions
+4 -3
View File
@@ -52,7 +52,8 @@ class InvestmentZones
});
}
/** @param array<string, mixed> $filters */
/** @param array<string, mixed> $filters
* @return Builder<InvestmentZone> */
public function search(array $filters, bool $management = false): Builder
{
$query = $management ? InvestmentZone::query() : $this->visible();
@@ -118,7 +119,7 @@ class InvestmentZones
$zone = InvestmentZone::whereKey($id)->lockForUpdate()->firstOrFail();
abort_if((int) $zone->version_no !== $version, 409, 'Versão alterada. Recarregue antes de aprovar.');
$source = DB::table('investment_legal_sources')->where('id', $zone->legal_source_id)->lockForUpdate()->first();
$evidence = is_array($zone->source_evidence) ? $zone->source_evidence : [];
$evidence = $zone->source_evidence ?? [];
$officialEvidence = collect($evidence)->contains(fn ($item) => in_array($item['source_type'] ?? null, ['government', 'institutional'], true)
&& str_starts_with((string) ($item['url'] ?? ''), 'https://') && trim((string) ($item['supports'] ?? '')) !== '');
$promoterEvidence = $zone->category === 'industrial_park' && collect($evidence)->contains(fn ($item) => ($item['source_type'] ?? null) === 'promoter'
@@ -166,7 +167,7 @@ class InvestmentZones
{
return DB::transaction(function () use ($id, $version, $actor) {
$location = DB::table('investment_zone_locations')->where('id', $id)->lockForUpdate()->first();
abort_unless($location, 404);
abort_unless($location !== null, 404);
abort_if((int) $location->version_no !== $version, 409, 'Version changed.');
abort_if((int) $location->editor_id === $actor, 403, 'Independent review required.');
abort_unless($location->validation_status === 'pending', 422, 'Territorial association already reviewed.');