User Panel: Phase-8-Abschluss, Titelbild/Lizenzen/Zeitzonen und KI-Pruef-Pipeline
Phase 8 (Rest) + Umbauten vom 10./11.06.: - Ein Titelbild pro PM (Cover 1280x580), SVG-Platzhalter-Set + Picker, PressReleaseCoverImage-Resolver - Lizenz-/Rechteformular nach "Lizenztyp Bildupload" (7 Lizenztypen, Personen-/Sachrechte-Status, bedingte Pflichtfelder, Risikohinweise) - Veroeffentlichungs-Box vereinfacht (Embargo aus der Form-UI entfernt), geplante Termine in Europe/Berlin (Speicherung UTC, DISPLAY_TIMEZONE) - Quota-Stub (users.press_release_quota) + monatlicher Reset-Command - Einreichungs-Modal einheitlich in Show/Create/Edit; Ghost-Buttons auf filled; PM-Editor-Layout responsive entkoppelt (.pr-editor-layout) KI-Pruef-Pipeline (Phasen 1-5 des Entwicklungsplans): - API-Haertung: status nicht mehr per API setzbar, eigene Submit-Route durch denselben Funnel (Blacklist, Quota, Status-Log) - Klassifikation Rot/Gelb/Gruen asynchron (Queue classification, OpenAI-Treiber + deterministischer Fallback), ki_audits-Audit-Log - Routing: Rot -> rejected + Mail, Gelb -> Review-Queue, Gruen -> Auto-Publish; Scheduler publiziert nur gruene faellige PMs - Content-Score 0-100 -> Stufe (Standard/Geprueft/Hochwertig) inkl. Editor-Panel und Badges; Re-Klassifikation/-Score bei Aenderung - Admin: KI-Badge + Filter, On-Demand-Pruefung mit Anbieter-Override Suite: 442 passed, 4 skipped. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
0efabaf446
commit
a000238ca8
141 changed files with 5922 additions and 1001 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Enums\PressReleaseClassification;
|
||||
use App\Enums\PressReleaseStatus;
|
||||
use App\Models\PressRelease;
|
||||
use App\Services\PressRelease\BlacklistViolationException;
|
||||
|
|
@ -11,11 +12,13 @@ use Illuminate\Support\Str;
|
|||
use Throwable;
|
||||
|
||||
/**
|
||||
* Veröffentlicht Pressemitteilungen mit Status `review` und einem
|
||||
* `scheduled_at`-Zeitpunkt, der erreicht/überschritten wurde.
|
||||
* Veröffentlicht Pressemitteilungen mit Status `review`, der KI-Klassifikation
|
||||
* `green` und einem `scheduled_at`-Zeitpunkt, der erreicht/überschritten wurde.
|
||||
*
|
||||
* Läuft regelmäßig per Scheduler (siehe routes/console.php). Idempotent:
|
||||
* berührt nur PRs in Review-Status — bereits publishte werden ignoriert.
|
||||
* berührt nur grüne PRs in Review-Status — bereits publishte werden ignoriert.
|
||||
* Gelb eingestufte PMs bleiben bewusst in der manuellen Admin-Queue, auch wenn
|
||||
* ihr Termin fällig ist.
|
||||
*
|
||||
* Blacklist-Treffer landen wie beim manuellen Publish im Reject-Status mit
|
||||
* Mail-Benachrichtigung des Autors.
|
||||
|
|
@ -43,6 +46,7 @@ class PublishScheduledPressReleases extends Command
|
|||
|
||||
$candidates = PressRelease::withoutGlobalScopes()
|
||||
->where('status', PressReleaseStatus::Review->value)
|
||||
->where('classification', PressReleaseClassification::Green->value)
|
||||
->whereNotNull('scheduled_at')
|
||||
->where('scheduled_at', '<=', $now)
|
||||
->orderBy('scheduled_at')
|
||||
|
|
|
|||
36
app/Console/Commands/ResetMonthlyPressReleaseQuota.php
Normal file
36
app/Console/Commands/ResetMonthlyPressReleaseQuota.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Setzt den monatlichen PM-Kontingent-Verbrauch aller User zurück.
|
||||
*
|
||||
* Temporärer Stub bis zum echten Tarif-/Credit-Modul. Läuft per Scheduler
|
||||
* am Monatsanfang (siehe routes/console.php).
|
||||
*/
|
||||
class ResetMonthlyPressReleaseQuota extends Command
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'press-releases:reset-monthly-quota';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Setzt den monatlichen PM-Kontingent-Verbrauch (press_release_quota_used_this_month) aller User auf 0 zurück.';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$affected = User::query()
|
||||
->where('press_release_quota_used_this_month', '>', 0)
|
||||
->update(['press_release_quota_used_this_month' => 0]);
|
||||
|
||||
$this->info(sprintf('Kontingent-Verbrauch für %d User zurückgesetzt.', $affected));
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
35
app/Console/Commands/RunClassificationQueue.php
Normal file
35
app/Console/Commands/RunClassificationQueue.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Arbeitet die KI-Klassifikations-Queue zum Testen einmalig ab – ohne
|
||||
* dauerhaft laufenden Queue-Worker.
|
||||
*
|
||||
* Standardmäßig werden alle anstehenden Jobs verarbeitet und der Worker
|
||||
* beendet sich danach (--stop-when-empty). Mit --once nur ein einzelner Job.
|
||||
*/
|
||||
class RunClassificationQueue extends Command
|
||||
{
|
||||
protected $signature = 'classification:work {--once : Nur einen einzelnen Job verarbeiten}';
|
||||
|
||||
protected $description = 'Verarbeitet die KI-Klassifikations-Queue einmalig (ohne Dauer-Worker).';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$options = [
|
||||
'--queue' => 'classification',
|
||||
'--tries' => 3,
|
||||
];
|
||||
|
||||
if ($this->option('once')) {
|
||||
$options['--once'] = true;
|
||||
} else {
|
||||
$options['--stop-when-empty'] = true;
|
||||
}
|
||||
|
||||
return $this->call('queue:work', $options);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue