- handlers/reviews.rs: admin CRUD for /api/admin/reviews (list, create, patch status, delete)
- handlers/coupons.rs: admin CRUD for /api/admin/coupons and /api/admin/discounts
- handlers/pricing.rs: admin CRUD for /api/admin/tracecoin-packages + /api/admin/reports/{users,revenue}
- handlers/dashboard.rs: replace all hardcoded fake data with real DB queries (registrations per day, revenue per week, live KPIs including pending approvals and total revenue)
- Migrations: extend reviews table (nullable FKs + admin fields), add coupons.title/role_keys, create discounts table
- gateway: route new admin paths to users service
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7 lines
309 B
SQL
7 lines
309 B
SQL
-- Add title and role_keys to coupons for admin UI
|
|
ALTER TABLE coupons
|
|
ADD COLUMN IF NOT EXISTS title VARCHAR(255),
|
|
ADD COLUMN IF NOT EXISTS role_keys TEXT[] NOT NULL DEFAULT '{}';
|
|
|
|
-- Backfill title from description
|
|
UPDATE coupons SET title = description WHERE title IS NULL AND description IS NOT NULL;
|