Files
root a9b39f3459 feat: Trinity Console v3.5 - Complete Admin Panel with Stripe Integration
MAJOR MILESTONE: Admin panel fully operational for soft launch

 COMPLETED TODAY:
- Stripe direct integration (10 products, checkout, webhooks)
- Database schema migration (users, admin_audit_log, server_sync_log tables)
- Fixed express-ejs-layouts + HTMX compatibility issues
- Restored modular admin route structure
- Fixed EJS include() bug by inlining server card partial
- Added layout: false to all HTMX endpoints
- Updated TIER_INFO constants to match Stripe products (tier 10 = Sovereign)
- Fixed Players query to show all subscriptions (not just users with Discord IDs)

🎯 WORKING ADMIN MODULES (7/7):
1. Dashboard - Overview
2. Servers - Server matrix with Pterodactyl data
3. Players - All subscribers with tier/status/Discord/Minecraft data
4. Financials - Revenue analytics with Fire/Frost breakdown
5. Grace Period - At-risk subscriber monitoring
6. Audit Log - Webhook event history
7. Role Audit - Subscription summary by tier

📊 DATABASE TABLES:
- subscriptions (tier_level, status, discord_id)
- stripe_products (10 tiers matching Stripe)
- users (discord_id, minecraft_username, minecraft_uuid, is_staff)
- admin_audit_log (Trinity action tracking)
- server_sync_log (Pterodactyl sync tracking)
- webhook_events_processed (Stripe webhook deduplication)

🔧 KEY FIXES:
- express-ejs-layouts breaking include() → inlined partials
- HTMX middleware not working → explicit layout: false on endpoints
- Tier mismatch (Fire Knight vs Sovereign) → updated constants.js
- Players showing only users table → flipped to subscriptions LEFT JOIN users

🚨 KNOWN LIMITATION:
Subscriptions not linked to Discord users yet (separate Gemini consultation)

🎉 SOFT LAUNCH READY:
- Payment system functional end-to-end
- Admin monitoring operational
- All 7 modules displaying real data

Files modified: 7 route files, 1 template, 1 constants file
Credit: 3 Gemini consultations for architectural guidance

Signed-off-by: Claude (Chronicler #57) <claude@firefrostgaming.com>
2026-04-03 14:29:01 -05:00
..