Selbstdeklaration des KI-Einsatzes je PM (Text) und je Bild inkl. Submit-Gate im PressReleaseService, versioniertem Audit-Trail (press_release_ai_declarations) und öffentlichem KI-Label in Einreicher-Stimme. Bestätigung im Submit-Modal ist Pflicht. Co-authored-by: Cursor <cursoragent@cursor.com>
52 lines
1.9 KiB
PHP
52 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Livewire\Concerns;
|
|
|
|
use App\Enums\AiTextDeclaration;
|
|
use Illuminate\Support\Carbon;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
/**
|
|
* KI-Kennzeichnung im Submit-Flow (Art. 50 KI-VO, Decision-Update 08.07.2026).
|
|
*
|
|
* Gemeinsame Properties + Validierung der vier Customer-Submit-Pfade
|
|
* (Erstellen, Bearbeiten, Detailansicht, Liste). Die Selbst-Deklaration ist
|
|
* Pflicht bei JEDEM Einreichen: ohne KI-Grad des Textes und verbindliche
|
|
* Bestätigung kein Submit. Die Bestätigung wird nicht vorbelegt — sie muss
|
|
* bei jedem Submit erneut gesetzt werden (Audit-Trail pro Einreichung).
|
|
*/
|
|
trait InteractsWithAiDeclaration
|
|
{
|
|
public ?string $aiTextDeclaration = null;
|
|
|
|
public bool $aiDeclarationConfirmed = false;
|
|
|
|
/**
|
|
* Pflichtprüfung vor dem Einreichen — Fehler erscheinen direkt im
|
|
* Submit-Modal. Entwurf-Speichern bleibt frei von dieser Pflicht.
|
|
*/
|
|
protected function validateAiDeclaration(): void
|
|
{
|
|
$this->validate([
|
|
'aiTextDeclaration' => ['required', Rule::in(AiTextDeclaration::values())],
|
|
'aiDeclarationConfirmed' => ['accepted'],
|
|
], [
|
|
'aiTextDeclaration.required' => __('Bitte angeben, ob und wie generative KI beim Text eingesetzt wurde.'),
|
|
'aiDeclarationConfirmed.accepted' => __('Bitte bestätigen, dass die Angaben zum KI-Einsatz vollständig und wahrheitsgemäß sind.'),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Spaltenwerte für die PM-Persistenz. Der Bestätigungszeitpunkt wird nur
|
|
* gestempelt, wenn die Checkbox tatsächlich gesetzt wurde.
|
|
*
|
|
* @return array{ai_text_declaration: ?string, ai_declaration_confirmed_at: ?Carbon}
|
|
*/
|
|
protected function aiDeclarationAttributes(): array
|
|
{
|
|
return [
|
|
'ai_text_declaration' => $this->aiTextDeclaration,
|
|
'ai_declaration_confirmed_at' => $this->aiDeclarationConfirmed ? now() : null,
|
|
];
|
|
}
|
|
}
|