images: Titelbild-Formular v2, Admin-Upload mit Kundenbestätigung, Entfernen mit Sofortlöschung (Bildkennzeichnung Block B)

- press-release-images-manager-v2 hinter IMAGE_RIGHTS_V2: drei Blöcke, Vorbelegung aus Metadaten, Bestätigung mit archiviertem Wortlaut, Bild-Bindung über Hash, Fokuspunkt und Letterbox, Zustände absent/prefilled/error
- CustomerImageConfirmation: Magic-Link an den Kontoinhaber, Karte auf der Kundenseite, Kanal magic_link
- PressReleaseImageRemover: nie veröffentlicht = alles sofort weg, veröffentlicht = Soft Delete, Original bleibt
- ConversionSource::MailImageConfirmation

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-09-22 09:31:32 +00:00
parent 214aea8910
commit 3d3ddc2dc8
11 changed files with 1380 additions and 5 deletions

View file

@ -0,0 +1,52 @@
<?php
namespace App\Services\PressRelease\Images;
use App\Models\PressReleaseImage;
use App\Services\Image\ImageService;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
/**
* Entfernt ein Titelbild (Bildkennzeichnung E.3, Decision-Update E4):
*
* - nie veröffentlicht: Derivate, Original, Snapshot und Bestätigung sofort
* und vollständig weg, die Zeile wird hart gelöscht;
* - veröffentlicht: Derivate weg, Zeile weich gelöscht; Original, Snapshot
* und Bestätigung bleiben für das Beweisarchiv (Block F übernimmt die
* Überführung und die Frist).
*
* Bestand ohne `rules_version` hat weder Original noch Protokoll und wird
* wie bisher behandelt (Derivate weg, Soft Delete).
*/
class PressReleaseImageRemover
{
public function __construct(private readonly ImageService $imageService) {}
public function remove(PressReleaseImage $image): void
{
$this->imageService->deletePressReleaseImage($image->disk, $image->path, $image->variants);
if ($image->wasEverPublished() || $image->isLegacyRules()) {
$image->delete();
return;
}
DB::transaction(function () use ($image): void {
foreach ($image->rightsConfirmations()->get() as $confirmation) {
$confirmation->purgeForUnpublished();
}
if ($image->original_path !== null) {
Storage::disk($image->original_disk ?? (string) config('images.originals_disk'))->delete($image->original_path);
}
if ($image->published_snapshot_path !== null) {
Storage::disk($image->original_disk ?? (string) config('images.originals_disk'))->delete($image->published_snapshot_path);
}
$image->forceDelete();
});
}
}