Phase 1: Refactor queries.js (1787 lines) into domain modules with facade pattern
- src/queries/{helpers,payin,payout,corporate,bi,client,provider,compliance}.queries.js
- New provider performance + compliance data layer queries
- Health check endpoint (GET /health)
Phase 2: Provider Performance Dashboard (src/admin-providers.js)
- Hero cards, sortable tables, Chart.js charts, date range filter
- API routes: /admin/api/providers, /admin/api/providers/failed, /admin/api/providers/trend
Phase 3: Excel Export (exceljs)
- CambioReal-branded exports for BI, clients, providers, transactions
- Export buttons added to BI and Client 360 dashboards
Phase 4: Alert System (node-cron + nodemailer)
- 5 alert rules: volume spike, spread anomaly, large tx, failed tx spike, provider inactivity
- SQLite alerts table, bell icon UI with acknowledge workflow
- Email notifications via SMTP
Phase 5: Enhanced Analytics
- Churn prediction: weighted RFM model (src/services/churn-predictor.js)
- Volume forecasting: exponential smoothing with confidence bands (src/services/forecast.js)
- Forecast chart in BI dashboard, churn risk in Client 360
Phase 6: SQLite Analytics Store (ETL)
- src/db-analytics.js: daily_metrics, client_health_daily, monthly_revenue tables
- src/etl/daily-sync.js: MySQL RDS → SQLite daily sync at 1 AM + 90-day backfill
- src/etl/data-quality.js: post-sync validation (row counts, reconciliation)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
493 B
JSON
22 lines
493 B
JSON
{
|
|
"name": "bi-agentes",
|
|
"version": "1.0.0",
|
|
"description": "BI Dashboard para agentes CambioReal",
|
|
"main": "server.js",
|
|
"scripts": {
|
|
"start": "node server.js",
|
|
"seed": "node scripts/seed-agente.js"
|
|
},
|
|
"dependencies": {
|
|
"bcrypt": "^5.1.1",
|
|
"better-sqlite3": "^11.7.0",
|
|
"dotenv": "^16.4.7",
|
|
"exceljs": "^4.4.0",
|
|
"express": "^4.21.2",
|
|
"express-session": "^1.18.1",
|
|
"mysql2": "^3.12.0",
|
|
"node-cron": "^4.2.1",
|
|
"nodemailer": "^8.0.1"
|
|
}
|
|
}
|