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
+5 -1
View File
@@ -241,7 +241,7 @@ class PortalProfileAccess
public function canEdit(User $actor, Opportunity $record, ?string $newType = null): bool
{
if ($record->isPrivateOfferPreparation() && data_get($record->workflow_context, 'private_offer_preparation.state') !== 'draft') {
if ($record->isPrivateOfferPreparation() && ! in_array($this->state($record), ['draft', 'needs_information'], true)) {
return false;
}
if ($record->owner_user_id === null) {
@@ -267,6 +267,10 @@ class PortalProfileAccess
public function state(Opportunity $record): string
{
if ($record->isPrivateOfferPreparation()) {
return data_get($record->workflow_context, 'private_offer_preparation.state', 'draft');
}
return $record->workflow_context['working_state'] ?? $record->status;
}