Files
Investidor-V2/outputs/investmoz-fintech-investimento-QA-20261015/diffs/app/Services/LegacyContent.php.patch
T
nala 6a76aac80f
tests / ci (push) Canceled after 0s
versao compilada 1
2026-10-16 09:17:28 +02:00

24 lines
1.3 KiB
Diff

--- antes/app/Services/LegacyContent.php
+++ candidata/app/Services/LegacyContent.php
@@ -169,6 +169,10 @@
$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.
}
}
@@ -179,6 +183,9 @@
'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']]);
+ }
});
}