Complete grouped collaborative editorial queues and native review coverage
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -24,6 +24,93 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
*/
|
||||
final class PortalEditorialWorkflow
|
||||
{
|
||||
public function legalReviewer(User $actor): bool
|
||||
{
|
||||
return $actor->hasVerifiedEmail() && (in_array($actor->id, config('editorial_workflow.legal_reviewers', []), true)
|
||||
|| in_array(strtolower($actor->email), config('editorial_workflow.legal_reviewer_emails', []), true));
|
||||
}
|
||||
|
||||
public function latestSubject(string $kind, string $key): ?\stdClass
|
||||
{
|
||||
return DB::table('portal_editorial_editions')->where('subject_kind', $kind)->where('subject_key', $key)->orderByDesc('revision_no')->first();
|
||||
}
|
||||
|
||||
public function subjectVersion(string $kind, string $key): int
|
||||
{
|
||||
return (int) ($this->latestSubject($kind, $key)->revision_no ?? 1);
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $fields
|
||||
* @param list<int> $contributors
|
||||
* @return EditorialPayload
|
||||
*/
|
||||
private function subjectSnapshot(string $kind, string $key, array $fields, array $contributors, bool $newRecord, bool $independent = false, bool $withdraw = false): array
|
||||
{
|
||||
$adapter = app(PortalEditorialSubjects::class);
|
||||
$snapshot = $adapter->snapshot($kind, $key, $fields);
|
||||
|
||||
return ['resource' => ['title' => (string) ($fields['name'] ?? $fields['title'] ?? $kind), '_subject' => ['kind' => $kind, 'key' => $key, 'fields' => $fields, 'new_record' => $newRecord, 'withdraw' => $withdraw]],
|
||||
'links' => [['target_type' => $adapter->definition($kind)['table'], 'target_key' => $key, 'context' => $snapshot['context']]],
|
||||
'files' => [], 'document_changes' => [], 'contributors' => $contributors, 'policy' => ['independent_required' => $independent || $adapter->independent($kind)]];
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $changes */
|
||||
public function saveSubject(User $actor, string $kind, string $key, int $expected, array $changes, bool $newRecord = false, ?bool $withdraw = null): \stdClass
|
||||
{
|
||||
$adapter = app(PortalEditorialSubjects::class);
|
||||
$adapter->authorize($actor, $kind, $key, true);
|
||||
|
||||
return DB::transaction(function () use ($actor, $kind, $key, $expected, $changes, $newRecord, $adapter, $withdraw) {
|
||||
$record = $adapter->lock($kind, $key, $changes);
|
||||
$previous = $this->latestSubject($kind, $key);
|
||||
abort_unless($expected === (int) ($previous->revision_no ?? ($newRecord ? 0 : 1)), 409, 'A proposta foi alterada. Conserve os campos e confira a versão actual.');
|
||||
$allowed = $adapter->definition($kind)['fields'];
|
||||
abort_unless(array_diff(array_keys($changes), $allowed) === [], 422, 'Campos fora do âmbito do registo.');
|
||||
if (! $previous && ! $newRecord) {
|
||||
$baseline = $this->subjectSnapshot($kind, $key, Arr::only(get_object_vars($record), $allowed), [], false);
|
||||
$public = ($record->data_classification ?? null) === 'public' || ($record->validation_status ?? null) === 'validated';
|
||||
DB::table('portal_editorial_editions')->insert(['id' => (string) Str::uuid(), 'subject_kind' => $kind, 'subject_key' => $key, 'revision_no' => 1, 'version' => 1,
|
||||
'state' => $public ? 'published' : 'archived', 'payload' => json_encode($baseline, JSON_THROW_ON_ERROR), 'content_hash' => $this->hash($baseline),
|
||||
'author_id' => $actor->id, 'legal_required' => false, 'published_at' => $public ? now() : null, 'created_at' => now(), 'updated_at' => now()]);
|
||||
}
|
||||
$working = $previous && $previous->published_at === null && $previous->state !== 'archived' ? $this->payload($previous) : null;
|
||||
$fields = array_replace(Arr::only(get_object_vars($record), $allowed), $working['resource']['_subject']['fields'] ?? [], $changes);
|
||||
$adapter->validate($kind, Arr::except($fields, ['territory_version']));
|
||||
if (array_key_exists('primary_territory_id', $changes) && ! array_key_exists('territory_version', $changes)) {
|
||||
$prior = $working['resource']['_subject']['fields'] ?? get_object_vars($record);
|
||||
if (($prior['primary_territory_id'] ?? null) !== $changes['primary_territory_id']) {
|
||||
$fields['territory_version'] = (int) ($prior['territory_version'] ?? 0) + 1;
|
||||
}
|
||||
}
|
||||
$contributors = array_values(array_unique([...($working['contributors'] ?? []), $actor->id]));
|
||||
$snapshot = $this->subjectSnapshot($kind, $key, $fields, $contributors, $newRecord || ($working['resource']['_subject']['new_record'] ?? false), $previous ? $this->requiresIndependent($previous) : false, $withdraw ?? ($working['resource']['_subject']['withdraw'] ?? false));
|
||||
$id = (string) Str::uuid();
|
||||
DB::table('portal_editorial_editions')->insert(['id' => $id, 'subject_kind' => $kind, 'subject_key' => $key, 'revision_no' => $expected + 1, 'version' => 1,
|
||||
'state' => 'draft', 'payload' => json_encode($snapshot, JSON_THROW_ON_ERROR), 'content_hash' => $this->hash($snapshot), 'author_id' => $actor->id,
|
||||
'legal_required' => false, 'created_at' => now(), 'updated_at' => now()]);
|
||||
$edition = DB::table('portal_editorial_editions')->where('id', $id)->firstOrFail();
|
||||
$this->audit($actor, $edition, 'draft_saved', 'Proposta privada guardada; registo anterior preservado.');
|
||||
|
||||
return $edition;
|
||||
});
|
||||
}
|
||||
|
||||
public function subjectPending(User $actor): int
|
||||
{
|
||||
if (! app(PortalEditorialSubjects::class)->available() || ! $actor->can('manage-portal') || app(PortalProfileAccess::class)->has($actor, 'auditor')) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $this->subjectQueue()->whereNotIn('e.state', ['published', 'archived'])->count();
|
||||
}
|
||||
|
||||
public function subjectQueue(): Builder
|
||||
{
|
||||
return DB::table('portal_editorial_editions as e')->whereNotNull('e.subject_kind')
|
||||
->whereNotExists(fn ($q) => $q->selectRaw('1')->from('portal_editorial_editions as later')->whereColumn('later.subject_kind', 'e.subject_kind')
|
||||
->whereColumn('later.subject_key', 'e.subject_key')->whereColumn('later.revision_no', '>', 'e.revision_no'));
|
||||
}
|
||||
|
||||
private const STRUCTURE_FIELDS = [
|
||||
'projects' => ['code', 'name', 'status', 'description', 'budget_amount', 'budget_currency', 'start_date', 'end_date', 'primary_territory_id', 'territory_version'],
|
||||
'economic_clusters' => ['code', 'name', 'status', 'sector', 'primary_territory_id', 'territory_version'],
|
||||
@@ -122,6 +209,12 @@ final class PortalEditorialWorkflow
|
||||
if ($access->full($actor) || $access->editorial($actor)) {
|
||||
return true;
|
||||
}
|
||||
if (app(PortalEditorialSubjects::class)->available() && $actor->can('manage-portal')) {
|
||||
return true;
|
||||
}
|
||||
if (app(PortalEditorialNativeNotices::class)->access($actor, 'cluster-competitiveness') || app(PortalEditorialNativeNotices::class)->access($actor, 'territorial-editorial-v1') || app(PortalEditorialNativeNotices::class)->access($actor, 'investment-zones')) {
|
||||
return true;
|
||||
}
|
||||
$navigation = app(PortalProfileAccess::class)->navigation($actor);
|
||||
|
||||
return ! empty($navigation['mine']) || ! empty($navigation['review']);
|
||||
@@ -158,6 +251,9 @@ final class PortalEditorialWorkflow
|
||||
if ((int) $notice->user_id !== $actor->id || ! $this->available() || ! $this->canEnter($actor)) {
|
||||
return false;
|
||||
}
|
||||
if ($notice->native_event_id ?? null) {
|
||||
return app(PortalEditorialNativeNotices::class)->visible($actor, $notice);
|
||||
}
|
||||
if ($notice->opportunity_id !== null) {
|
||||
$record = Opportunity::query()->whereKey($notice->opportunity_id)->first();
|
||||
|
||||
@@ -168,7 +264,12 @@ final class PortalEditorialWorkflow
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
if ($edition->demographic_import_id ?? null) {
|
||||
if ($edition->subject_kind ?? null) {
|
||||
if (! app(PortalEditorialSubjects::class)->available()) {
|
||||
return false;
|
||||
}
|
||||
app(PortalEditorialSubjects::class)->authorize($actor, $edition->subject_kind, $edition->subject_key);
|
||||
} elseif ($edition->demographic_import_id ?? null) {
|
||||
if (! $this->demographyAvailable() || ! $actor->two_factor_confirmed_at || ! $actor->two_factor_secret) {
|
||||
return false;
|
||||
}
|
||||
@@ -201,6 +302,9 @@ final class PortalEditorialWorkflow
|
||||
public function requiresIndependent(\stdClass $edition): bool
|
||||
{
|
||||
$p = $this->payload($edition);
|
||||
if ($edition->subject_kind ?? null) {
|
||||
return $p['policy']['independent_required'] || app(PortalEditorialSubjects::class)->independent($edition->subject_kind);
|
||||
}
|
||||
if ($edition->demographic_import_id ?? null) {
|
||||
return $p['policy']['independent_required'] || in_array('demography', config('editorial_workflow.independent_approval.kinds', []), true);
|
||||
}
|
||||
@@ -220,9 +324,18 @@ final class PortalEditorialWorkflow
|
||||
if (! $this->visibleNotice($actor, $notice)) {
|
||||
continue;
|
||||
}
|
||||
if ($notice->native_event_id ?? null) {
|
||||
$result[] = app(PortalEditorialNativeNotices::class)->present($notice);
|
||||
if (count($result) === 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
$edition = $notice->edition_id ? DB::table('portal_editorial_editions')->where('id', $notice->edition_id)->first() : null;
|
||||
$subjectHref = ($edition->subject_kind ?? null) ? '/management/editorial/subjects/'.$edition->subject_kind.'/'.$edition->subject_key.'?edition='.$edition->id : null;
|
||||
$result[] = ['id' => $notice->id, 'action' => $notice->action, 'read_at' => $notice->read_at,
|
||||
'href' => $notice->opportunity_id !== null ? '/minhas-oportunidades/'.$notice->opportunity_id : (($edition->demographic_import_id ?? null) ? '/management/editorial/demography/'.$edition->demographic_import_id : (($edition->dossier_id ?? null) ? '/management/editorial/portfolio/'.$edition->dossier_id : '/management/editorial/resources/'.$edition->resource_id)).'?edition='.$notice->edition_id, 'reference' => $notice->opportunity_id !== null ? 'Revisão '.$notice->opportunity_version : 'Edição '.$edition->revision_no];
|
||||
'href' => $subjectHref ?? ($notice->opportunity_id !== null ? '/minhas-oportunidades/'.$notice->opportunity_id : (($edition->demographic_import_id ?? null) ? '/management/editorial/demography/'.$edition->demographic_import_id : (($edition->dossier_id ?? null) ? '/management/editorial/portfolio/'.$edition->dossier_id : '/management/editorial/resources/'.$edition->resource_id)).'?edition='.$notice->edition_id), 'reference' => $notice->opportunity_id !== null ? 'Revisão '.$notice->opportunity_version : 'Edição '.$edition->revision_no];
|
||||
if (count($result) === 50) {
|
||||
break;
|
||||
}
|
||||
@@ -251,7 +364,9 @@ final class PortalEditorialWorkflow
|
||||
return null;
|
||||
}
|
||||
|
||||
return ['pending' => $this->queue($actor)->whereNotIn('e.state', ['published', 'archived'])->count() + $this->opportunityPending($actor) + $this->portfolioPending($actor) + $this->demographyPending($actor), 'unread' => $this->unreadCount($actor)];
|
||||
$native = app(PortalEditorialNativeNotices::class)->pending($actor);
|
||||
|
||||
return ['pending' => $this->queue($actor)->whereNotIn('e.state', ['published', 'archived'])->count() + $this->opportunityPending($actor) + $this->portfolioPending($actor) + $this->demographyPending($actor) + $this->subjectPending($actor) + $native['clusters'] + $native['territories'] + $native['zones'], 'unread' => $this->unreadCount($actor)];
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $resource
|
||||
@@ -450,6 +565,11 @@ final class PortalEditorialWorkflow
|
||||
*/
|
||||
private function refreshPayload(\stdClass $edition, array $payload): array
|
||||
{
|
||||
if ($edition->subject_kind ?? null) {
|
||||
$subject = $payload['resource']['_subject'];
|
||||
|
||||
return $this->subjectSnapshot($edition->subject_kind, $edition->subject_key, $subject['fields'], $payload['contributors'], $subject['new_record'] ?? false, $payload['policy']['independent_required'], $subject['withdraw'] ?? false);
|
||||
}
|
||||
if ($edition->demographic_import_id ?? null) {
|
||||
return $this->demographySnapshot($edition->demographic_import_id, $payload['contributors'], $payload['policy']);
|
||||
}
|
||||
@@ -697,10 +817,12 @@ final class PortalEditorialWorkflow
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $input */
|
||||
public function transition(User $actor, int|string $resource, string $id, array $input, bool $portfolio = false, bool $demography = false): \stdClass
|
||||
public function transition(User $actor, int|string $resource, string $id, array $input, bool $portfolio = false, bool $demography = false, ?string $subject = null): \stdClass
|
||||
{
|
||||
abort_if($portfolio && $demography, 422);
|
||||
if ($demography) {
|
||||
abort_if(count(array_filter([$portfolio, $demography, $subject !== null])) > 1, 422);
|
||||
if ($subject !== null) {
|
||||
app(PortalEditorialSubjects::class)->authorize($actor, $subject, (string) $resource, true);
|
||||
} elseif ($demography) {
|
||||
$this->authorizeDemography($actor, (string) $resource, true);
|
||||
} elseif ($portfolio) {
|
||||
$this->authorizePortfolio($actor, (string) $resource, true);
|
||||
@@ -713,18 +835,25 @@ final class PortalEditorialWorkflow
|
||||
}
|
||||
$data = validator($input, ['version' => 'required|integer|min:1', 'action' => 'required|in:submit,start_review,return,reject,legal_validate,approve,publish,archive', 'reason' => $reason, 'assigned_to' => 'nullable|integer|exists:users,id'])->validate();
|
||||
|
||||
return DB::transaction(function () use ($actor, $resource, $id, $data, $portfolio, $demography) {
|
||||
$r = DB::table($demography ? 'demographic_imports' : ($portfolio ? 'investment_dossiers' : 'portal_resources'))->where('id', $resource)->lockForUpdate()->first();
|
||||
$e = DB::table('portal_editorial_editions')->where('id', $id)->where($demography ? 'demographic_import_id' : ($portfolio ? 'dossier_id' : 'resource_id'), $resource)->lockForUpdate()->first();
|
||||
return DB::transaction(function () use ($actor, $resource, $id, $data, $portfolio, $demography, $subject) {
|
||||
if ($subject !== null) {
|
||||
$candidate = DB::table('portal_editorial_editions')->where('subject_kind', $subject)->where('subject_key', $resource)->where('id', $id)->first();
|
||||
abort_unless($candidate !== null, 404);
|
||||
$r = app(PortalEditorialSubjects::class)->lock($subject, (string) $resource, $this->payload($candidate)['resource']['_subject']['fields']);
|
||||
$e = DB::table('portal_editorial_editions')->where('id', $id)->lockForUpdate()->first();
|
||||
} else {
|
||||
$r = DB::table($demography ? 'demographic_imports' : ($portfolio ? 'investment_dossiers' : 'portal_resources'))->where('id', $resource)->lockForUpdate()->first();
|
||||
$e = DB::table('portal_editorial_editions')->where('id', $id)->where($demography ? 'demographic_import_id' : ($portfolio ? 'dossier_id' : 'resource_id'), $resource)->lockForUpdate()->first();
|
||||
}
|
||||
abort_unless($r && $e, 404);
|
||||
$latest = $demography ? $this->latestDemography((string) $resource) : ($portfolio ? $this->latestPortfolio((string) $resource) : $this->latest((int) $resource));
|
||||
$latest = $subject !== null ? $this->latestSubject($subject, (string) $resource) : ($demography ? $this->latestDemography((string) $resource) : ($portfolio ? $this->latestPortfolio((string) $resource) : $this->latest((int) $resource)));
|
||||
abort_unless((int) $e->version === (int) $data['version'] && $latest?->id === $id, 409, 'Versão desactualizada.');
|
||||
$action = $data['action'];
|
||||
if (! in_array($action, ['submit', 'archive'], true)) {
|
||||
abort_unless(app(DocumentManagementAccess::class)->full($actor), 403, 'Responsável de revisão/publicação necessário.');
|
||||
abort_unless($subject !== null ? $actor->can('manage-portal') : app(DocumentManagementAccess::class)->full($actor), 403, 'Responsável de revisão/publicação necessário.');
|
||||
}
|
||||
if ($action === 'archive') {
|
||||
abort_unless((int) $e->author_id === $actor->id || app(DocumentManagementAccess::class)->full($actor), 403);
|
||||
abort_unless((int) $e->author_id === $actor->id || ($subject !== null ? $actor->can('manage-portal') : app(DocumentManagementAccess::class)->full($actor)), 403);
|
||||
}
|
||||
$allowed = match ($action) {
|
||||
'submit' => ['draft', 'returned'], 'start_review' => ['submitted'], 'return', 'reject', 'legal_validate', 'approve' => ['in_review'], 'publish' => ['approved'], 'archive' => ['draft', 'submitted', 'in_review', 'returned', 'rejected', 'approved', 'published'],
|
||||
@@ -737,7 +866,7 @@ final class PortalEditorialWorkflow
|
||||
abort_unless(hash_equals($e->content_hash, $this->hash($this->refreshPayload($e, $payload))), 409, 'Conteúdo, contexto ou anexos alterados. Guarde uma nova edição e obtenha nova aprovação.');
|
||||
}
|
||||
$updates = [];
|
||||
if ((in_array($action, ['approve', 'legal_validate'], true) || ($portfolio && $action === 'publish')) && $this->requiresIndependent($e)) {
|
||||
if ((in_array($action, ['approve', 'legal_validate'], true) || (($portfolio || $subject !== null) && $action === 'publish')) && $this->requiresIndependent($e)) {
|
||||
abort_if(in_array($actor->id, $payload['contributors'], true), 403, 'Esta edição exige revisão independente.');
|
||||
}
|
||||
if (in_array($action, ['approve', 'legal_validate'], true)) {
|
||||
@@ -746,7 +875,7 @@ final class PortalEditorialWorkflow
|
||||
}
|
||||
}
|
||||
if ($action === 'legal_validate') {
|
||||
abort_unless(in_array($actor->id, config('editorial_workflow.legal_reviewers', []), true), 403, 'Designação jurídica explícita necessária.');
|
||||
abort_unless($this->legalReviewer($actor), 403, 'Designação jurídica explícita necessária.');
|
||||
$updates['legal_validation'] = json_encode($this->decision($actor, $e, $data['reason']), JSON_THROW_ON_ERROR);
|
||||
}
|
||||
if ($action === 'approve') {
|
||||
@@ -760,7 +889,9 @@ final class PortalEditorialWorkflow
|
||||
if ($e->legal_required) {
|
||||
$this->assertDecision($e, $e->legal_validation, 'Validação jurídica desta edição necessária.', true);
|
||||
}
|
||||
if ($demography) {
|
||||
if ($subject !== null) {
|
||||
app(PortalEditorialSubjects::class)->publish($actor, $r, $e, $payload);
|
||||
} elseif ($demography) {
|
||||
$this->publishDemography($actor, $r, $e, $payload, $data['reason']);
|
||||
} elseif ($portfolio) {
|
||||
$this->publishPortfolio($actor, $r, $e, $payload);
|
||||
@@ -771,12 +902,14 @@ final class PortalEditorialWorkflow
|
||||
}
|
||||
if ($action === 'submit' && isset($data['assigned_to'])) {
|
||||
$responsible = User::query()->whereKey($data['assigned_to'])->firstOrFail();
|
||||
abort_unless(app(DocumentManagementAccess::class)->full($responsible) && ! app(PortalProfileAccess::class)->has($responsible, 'auditor'), 422, 'Responsável sem autoridade editorial.');
|
||||
abort_unless(($subject !== null ? $responsible->can('manage-portal') : app(DocumentManagementAccess::class)->full($responsible)) && ! app(PortalProfileAccess::class)->has($responsible, 'auditor'), 422, 'Responsável sem autoridade editorial.');
|
||||
abort_if($portfolio && ! $responsible->can('manage-portal'), 422, 'Responsável sem autoridade sobre a carteira.');
|
||||
$updates['assigned_to'] = $responsible->id;
|
||||
}
|
||||
if ($action === 'archive' && $e->state === 'published') {
|
||||
if ($demography) {
|
||||
if ($subject !== null) {
|
||||
app(PortalEditorialSubjects::class)->archive($actor, $r, $e);
|
||||
} elseif ($demography) {
|
||||
$this->demographyStatus($actor, $r, 'disabled', $data['reason'], $e->id);
|
||||
} elseif ($portfolio) {
|
||||
DB::table('investment_dossiers')->where('id', $resource)->update(['publication_status' => 'draft', 'version_no' => (int) $r->version_no + 1, 'updated_at' => now()]);
|
||||
@@ -806,10 +939,10 @@ final class PortalEditorialWorkflow
|
||||
$d = $decision ? json_decode($decision, true, 512, JSON_THROW_ON_ERROR) : [];
|
||||
abort_unless(($d['edition_id'] ?? null) === $e->id && ($d['hash'] ?? null) === $e->content_hash, 422, $message);
|
||||
$actor = User::query()->whereKey($d['actor_id'] ?? 0)->first();
|
||||
abort_unless($actor && $actor->hasVerifiedEmail() && app(DocumentManagementAccess::class)->full($actor) && ! app(PortalProfileAccess::class)->has($actor, 'auditor'), 403, 'Autoridade da decisão revogada.');
|
||||
abort_unless($actor && $actor->hasVerifiedEmail() && (($e->subject_kind ?? null) ? $actor->can('manage-portal') : app(DocumentManagementAccess::class)->full($actor)) && ! app(PortalProfileAccess::class)->has($actor, 'auditor'), 403, 'Autoridade da decisão revogada.');
|
||||
abort_if(($e->dossier_id ?? null) && ! $actor->can('manage-portal'), 403, 'Autoridade sobre a carteira revogada.');
|
||||
if ($legal) {
|
||||
abort_unless(in_array($actor->id, config('editorial_workflow.legal_reviewers', []), true), 403, 'Designação jurídica revogada.');
|
||||
abort_unless($this->legalReviewer($actor), 403, 'Designação jurídica revogada.');
|
||||
}
|
||||
if ($this->requiresIndependent($e)) {
|
||||
abort_if(in_array($actor->id, $this->payload($e)['contributors'], true), 403, 'A decisão exige aprovação independente.');
|
||||
@@ -850,7 +983,7 @@ final class PortalEditorialWorkflow
|
||||
private function audit(User $actor, \stdClass $e, string $action, string $reason, ?string $nextState = null): void
|
||||
{
|
||||
$current = DB::table('portal_editorial_editions')->where('id', $e->id)->first();
|
||||
app(DocumentManagementAccess::class)->audit($actor, 'editorial_'.$action, ['resource_id' => $e->resource_id, 'dossier_id' => $e->dossier_id ?? null, 'demographic_import_id' => $e->demographic_import_id ?? null, 'edition_id' => $e->id, 'hash' => $e->content_hash, 'version' => $e->version,
|
||||
app(DocumentManagementAccess::class)->audit($actor, 'editorial_'.$action, ['resource_id' => $e->resource_id, 'dossier_id' => $e->dossier_id ?? null, 'demographic_import_id' => $e->demographic_import_id ?? null, 'subject_kind' => $e->subject_kind ?? null, 'subject_key' => $e->subject_key ?? null, 'edition_id' => $e->id, 'hash' => $e->content_hash, 'version' => $e->version,
|
||||
'from_state' => $e->state, 'to_state' => $nextState ?? $e->state, 'result_version' => $current->version, 'approval' => $current->approval, 'legal_validation' => $current->legal_validation, 'reason' => $reason]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user