versao compilada 1
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-16 09:17:28 +02:00
parent c13f250b87
commit 6a76aac80f
901 changed files with 253428 additions and 252 deletions
+12
View File
@@ -18,6 +18,11 @@ final class LegacyContent
{
public function available(): bool
{
// Explicit delivery gate; document publication and access checks remain independent.
if (config('portal.legacy_content_enabled', false)) {
return true;
}
if (! config('portal.legacy_content_qa_enabled') || ! app()->environment('testing')
|| config('database.connections.pgsql.host') !== '127.0.0.1'
|| config('database.connections.pgsql.url') || (int) config('database.connections.pgsql.port') !== 55441) {
@@ -164,6 +169,10 @@ final class LegacyContent
$payload = $desk->decode($case->payload);
foreach ($payload['investor_path']['content_sources'] ?? [] as $existing) {
if ($existing['resource_id'] === $article['id'] && $existing['sha256'] === $article['sha256']) {
if ($article['sector']) {
app(SectorInvestment::class)->attach($actor, $caseId, ['version' => $data['version'], 'sector_slug' => $article['sector']['slug']]);
}
return; // Same source/version replay: neither another reference nor another event.
}
}
@@ -174,6 +183,9 @@ final class LegacyContent
'saved_at' => now()->toIso8601String()];
DB::table('desk_cases')->where('id', $caseId)->update(['payload' => $desk->encode($payload), 'version' => $case->version + 1, 'updated_at' => now()]);
$desk->event($desk->case($actor, $caseId), $actor, 'legacy_content_referenced', ['resource_id' => $article['id'], 'sha256' => $article['sha256']]);
if ($article['sector']) {
app(SectorInvestment::class)->attach($actor, $caseId, ['version' => $case->version + 1, 'sector_slug' => $article['sector']['slug']]);
}
});
}