From f743556dc59936ac742fbe5c42a82db91fc2b9d8 Mon Sep 17 00:00:00 2001 From: chahinebrini Date: Sat, 9 May 2026 15:55:18 +0200 Subject: [PATCH] feat(domain-approval): Legend-priority + 24h-SLA-deadline + user-info cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User-Wunsch: Legend-User priorisieren, 24h Approval-SLA, sichtbar wer/wann/Restzeit. Backend: - Schema: DomainSubmission.user @relation Profile (FK + composite-index status,createdAt) - Migration: 20260509_domain_submission_user_relation (additive, FK via DO $$ block, idempotent IF NOT EXISTS index) - db/domains.ts getPendingSubmissions enriched: - include user { id, nickname, plan } - returns PendingSubmissionRow with planPriority (legend=2, pro=1, free=0) - deadlineAt = createdAt + 24h - msUntilDeadline (negative when overdue) - sort: Legend > Pro > Free, FIFO innerhalb plan-bucket - Constant ADMIN_APPROVAL_SLA_MS exported Tests: - backend/tests/admin/domains.test.ts — 5 cases (priority-sort, FIFO, deadline, overdue, user-null fallback). 83 backend tests passing total. Frontend (apps/admin/pages/domains.vue): - Card-list (statt UTable — sichtbarer urgency-stripe links) - Filter-chips „Alle | Nur Legend | Überfällig" mit live counts - Per row: nickname, plan-badge (Legend = sparkles + warning/gold), request-age (relative), deadline-countdown („noch 18h" / „ÜBERFÄLLIG (6h)") - Visual urgency-stripe (1px border-left full-height): - Overdue: red-600 + warning-icon - <2h: red-500 - Legend: amber-400 (gold) - <12h: yellow-500 - Normal: gray-700 ⚠️ Migration auto-deploy via pipeline (b38bf17 detection). Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/admin/pages/domains.vue | 370 +++++++++++++----- .../migration.sql | 37 ++ backend/prisma/schema.prisma | 7 +- backend/server/db/domains.ts | 66 +++- backend/tests/admin/domains.test.ts | 122 ++++++ 5 files changed, 496 insertions(+), 106 deletions(-) create mode 100644 backend/prisma/migrations/20260509_domain_submission_user_relation/migration.sql create mode 100644 backend/tests/admin/domains.test.ts diff --git a/apps/admin/pages/domains.vue b/apps/admin/pages/domains.vue index aed9184..e7f3893 100644 --- a/apps/admin/pages/domains.vue +++ b/apps/admin/pages/domains.vue @@ -5,6 +5,7 @@

Domain-Approval

Ausstehende Blocker-Domain-Anfragen genehmigen oder ablehnen. + Legend-Requests werden priorisiert behandelt — SLA: 24h.

+ +
+ + Filter: + + + {{ opt.label }} + + ({{ opt.count }}) + + + + {{ filteredSubmissions.length }} / {{ submissions.length }} sichtbar + + {{ overdueCount }} überfällig + + +
+
-

Keine pending requests

+

+ {{ + submissions && submissions.length > 0 + ? "Keine Treffer für aktuellen Filter" + : "Keine pending requests" + }} +

Alle Domain-Anfragen sind aktuell bearbeitet.

- -
- +
+
- - - - - - - - - - + Approve + + + Reject + +
+
@@ -189,8 +259,6 @@