feat: integrate private offers with existing editorial workflow
This commit is contained in:
@@ -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))) {
|
||||
|
||||
Reference in New Issue
Block a user