- legal_document_acceptances (insert-only), LegalAcceptanceGate, Pflicht-Schalter im Einreichungs-Modal über den gemeinsamen Trait; API: GET/POST /api/v1/legal/acceptances, submit antwortet 428 mit den geforderten Fassungen; LEGAL_ACCEPTANCE_GATE - ImageService: og-Variante (1200×630) mit halbtransparentem Balken und Inter SemiBold, regenerateOgVariant() für Korrekturen und Bestand; Fokuspunkt/Letterbox getestet - Uploader brennt den Nachweis beim Upload ein, ImageCorrectionService baut die OG-Variante nach einer Korrektur neu; Artikelseite nutzt og für og:image - Teaser: Nachweis in alt/title (Feed, Hero, Kategorie, Newsroom), Unterschrift am Hero-Bild; PressRelease::cardImageCredit() Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
63 lines
1.4 KiB
PHP
63 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* Aktive Annahme einer Rechtstext-Fassung durch einen Nutzer (Block G).
|
|
* Insert-only.
|
|
*/
|
|
class LegalDocumentAcceptance extends Model
|
|
{
|
|
public const UPDATED_AT = null;
|
|
|
|
public const CONTEXT_SUBMIT = 'submit';
|
|
|
|
public const CONTEXT_API = 'api';
|
|
|
|
public const CONTEXT_GATE = 'gate';
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'legal_document_id',
|
|
'type',
|
|
'version',
|
|
'context',
|
|
'ip_hmac',
|
|
'user_agent',
|
|
'accepted_at',
|
|
'created_at',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'accepted_at' => 'datetime',
|
|
'created_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::updating(fn () => throw new \LogicException('legal_document_acceptances ist insert-only.'));
|
|
static::deleting(fn () => throw new \LogicException('legal_document_acceptances wird nicht gelöscht.'));
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<User, $this>
|
|
*/
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<LegalDocument, $this>
|
|
*/
|
|
public function legalDocument(): BelongsTo
|
|
{
|
|
return $this->belongsTo(LegalDocument::class);
|
|
}
|
|
}
|