presseportale/app/Services/PressRelease/Images/ImageUploadActor.php
Kevin Adametz e9bdff3ad3 images: Datenmodell, Textarchiv, Herkunftsprüfung und gemeinsamer Uploader für Formular v2 (Bildkennzeichnung Block A)
- press_release_images: Kundenangabe/Portalkennzeichnung getrennt, Herkunftsbefund, Beweisoriginal, Snapshot-Pfade, published_ever_at, rules_version, Fokus/Letterbox; Bestand unangetastet
- legal_texts (insert-only) mit img-confirm-v1 (alter Wortlaut), v2 (AGB 0.6), v3 (AGB 0.7, noch ohne Datum); image-rights:backfill-confirmations
- image_rights_confirmations polymorph, insert-only, IP als versionierter HMAC; Löschung nur für nie veröffentlichte Uploads
- ImageProvenanceInspector (Imagick/exif): IPTC, XMP, EXIF; algorithmicallyEnhanced nur Vermerk; unlesbare Datei = error
- PressReleaseImageUploader: Original vor Derivaten, Hash-Bindung, Titelbild-Regel unter Sperre, Dateien bei Fehlern zurückgerollt; Admin-Upload ohne Bestätigung
- ImageService: kein Rückfall auf die Quelldatei, og-Variante, Fokuspunkt und no_crop

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 09:22:05 +00:00

46 lines
1.4 KiB
PHP

<?php
namespace App\Services\PressRelease\Images;
use App\Enums\ConfirmationChannel;
use App\Models\User;
/**
* Wer ein Bild hochlädt und über welchen Weg (Bildkennzeichnung A.6).
*
* `channel = null` ist der Admin-Upload: Der Admin bestätigt nichts, das
* Bild wartet auf die Kundenbestätigung per Magic-Link (Decision-Update E10).
* `user` ist bei Form und API der Kontoinhaber und damit der
* Vertragspartner (E1); beim Admin-Upload der handelnde Admin.
*/
final readonly class ImageUploadActor
{
public function __construct(
public ?User $user,
public ?ConfirmationChannel $channel,
public ?int $tokenId = null,
public ?string $ip = null,
public ?string $userAgent = null,
public bool $isAdmin = false,
) {}
public static function form(User $user, ?string $ip, ?string $userAgent): self
{
return new self($user, ConfirmationChannel::Form, null, $ip, $userAgent);
}
public static function api(User $user, ?int $tokenId, ?string $ip, ?string $userAgent): self
{
return new self($user, ConfirmationChannel::Api, $tokenId, $ip, $userAgent);
}
public static function admin(User $admin, ?string $ip, ?string $userAgent): self
{
return new self($admin, null, null, $ip, $userAgent, isAdmin: true);
}
public function confirmsImmediately(): bool
{
return $this->channel !== null;
}
}