fix(offers): preserve description in authorised investment context

This commit is contained in:
2026-11-14 18:39:25 +02:00
parent ed2fd86f6b
commit 9a01426864
21 changed files with 1219 additions and 10 deletions
+11
View File
@@ -193,6 +193,17 @@ final class InvestorContext
$href = $published ? '/oportunidades/'.$o->slug : '/minhas-oportunidades/'.$o->id.'/view';
$version = $o->management_version;
$fields = ['project_title' => $title, 'project_summary' => $draft['canonical']['executive_summary'] ?? $o->summary];
if ($o->isPrivateOfferPreparation()) {
// Offers reuse Opportunity, but their preparation writes description,
// not the canonical executive summary. Keep this authorised private
// projection explicit: never copy private_offer (price/finances/contact).
$title = $draft['title'] ?? $o->title;
$summary = $fields['project_summary'];
$fields['project_title'] = $title;
$fields['project_summary'] = is_string($summary) && trim($summary) !== ''
? $summary : ($draft['description'] ?? null);
$href = '/minhas-oportunidades/ofertas/'.$o->id;
}
if ($o->sector) {
$fields['sector_id'] = (string) $o->sector_id;
$fields['sector'] = $o->sector->name;