Claude (Chronicler #57)
f7fec6fb84
feat: convert financials template to EJS and add database queries
ARCHITECTURE FIX (per Gemini consultation):
Old JavaScript template literals converted to proper EJS
CHANGES:
1. Converted admin/financials/index.ejs from JavaScript to EJS
- Changed ${variable} to <%= variable %>
- Removed let bodyContent wrapper
- Added EJS loops for tier breakdown table
2. Created FinancialsService.js with PostgreSQL queries:
- Active subscribers count
- Recognized MRR calculation
- At-risk subscribers (grace period)
- Lifetime revenue (Awakened + Sovereign)
- Fire vs Frost path breakdown
- Tier-level performance metrics
3. Updated admin.js financials route:
- Import FinancialsService
- Fetch real data from database
- Pass metrics, paths, tierBreakdown to template
TESTING:
Visit /admin/financials - should show real subscription data
Credit: Gemini consultation - template architecture fix
Signed-off-by: Claude (Chronicler #57) <claude@firefrostgaming.com>