feat: integrate private offers with existing editorial workflow

This commit is contained in:
2026-11-14 16:20:30 +02:00
parent 6e302db62e
commit 91c1857368
19 changed files with 1353 additions and 30 deletions
+6
View File
@@ -195,6 +195,12 @@ class OpportunityManagement
$record->management_closed_once = true;
$previous = $record->management_draft ? json_decode($record->management_draft, true) : $record->only(self::FIELDS);
$record->management_draft = json_encode([...$previous, ...$changes], JSON_THROW_ON_ERROR);
if ($privateOffer) {
// All columns of an Offer remain private; keep scope/category and location current.
foreach (array_intersect_key($changes, array_flip(self::FIELDS)) as $field => $value) {
$record->{$field} = $value;
}
}
} else {
foreach ($changes as $key => $value) {
if (in_array($key, ['real_estate', 'canonical', 'proactive', 'private_offer', 'maturity_stage', 'maturity_catalogue_version'], true) || (($changes['maturity_catalogue_version'] ?? null) === OpportunityMaturity::VERSION && in_array($key, ['maturity_level', 'maturity_label'], true))) {