forceFill([ 'precheck_reviewed_at' => now(), 'precheck_reviewed_by' => $admin->getKey(), 'precheck_review_note' => $note, // Nur der eigene Grund fällt (Umsetzungsaudit 29.09., B-07): // ein Rückhalt aus dem Korrekturweg bleibt bestehen. 'precheck_withheld_at' => null, ])->save(); $image->markPublishedIfNowPublic(); $this->audit($image, 'approved', $note); }); $pressRelease = $image->pressRelease; if ($pressRelease?->status === PressReleaseStatus::Published && $image->isPubliclyDeliverable()) { // Jetzt erst öffentlich: Veröffentlichungssnapshot (N09) nach // dem N08-Muster — Fehler werden gemeldet, nicht geworfen. try { $this->snapshots->capture($image, $pressRelease); } catch (Throwable $exception) { report($exception); } } if ($pressRelease?->published_at !== null) { try { WebCaches::forgetPublicPages(); } catch (Throwable $exception) { report($exception); } } } public function reject(PressReleaseImage $image, User $admin, string $note): void { DB::transaction(function () use ($image, $admin, $note): void { $image->forceFill([ 'precheck_reviewed_at' => now(), 'precheck_reviewed_by' => $admin->getKey(), 'precheck_review_note' => $note, ])->save(); $this->audit($image, 'rejected', $note); }); $this->remover->remove($image, $admin, ArchiveEvent::ImageRemoved, ArchiveReasonCategory::OwnDecision); } private function audit(PressReleaseImage $image, string $decision, string $note): void { KiAudit::query()->create([ 'press_release_id' => $image->press_release_id, 'type' => KiAudit::TYPE_IMAGE_PRECHECK_REVIEW, 'provider' => 'admin', 'model' => null, 'result' => $decision, 'reason' => $note, 'raw_response' => [ 'image_id' => $image->getKey(), 'reviewed_by' => $image->precheck_reviewed_by, 'precheck' => $image->precheck, ], 'created_at' => now(), ]); } }