feat: add admin apis

This commit is contained in:
Krispire Admin
2026-06-16 14:47:45 +05:30
parent aa61f4f0b1
commit a49bf7591e
24 changed files with 1164 additions and 22 deletions
+15
View File
@@ -0,0 +1,15 @@
-- Admin panel support. All additive — existing columns/queries are untouched,
-- so the public API and the existing frontend keep working unchanged.
-- Feedback replies: an admin can write a reply that gets emailed to the
-- submitter. reply_message holds the text, replied_at stamps when it was sent
-- (one-way, like resolved_at). Replying also resolves the row.
ALTER TABLE feedback
ADD COLUMN IF NOT EXISTS reply_message TEXT,
ADD COLUMN IF NOT EXISTS replied_at TIMESTAMPTZ;
-- Admin → user direct messages reuse the notifications feed. Event-driven
-- notifications carry no free text, so add an optional body column that only
-- the 'admin_message' kind populates (all existing kinds leave it NULL).
ALTER TABLE notifications
ADD COLUMN IF NOT EXISTS body TEXT;