06/05 Optimize app: report upgrades
This commit is contained in:
@@ -10,6 +10,9 @@ from app.services.ai_service import get_latest_daily_insight
|
||||
from app.services.account_service import get_total_assets, get_total_liabilities
|
||||
from datetime import date, datetime, timedelta
|
||||
import calendar
|
||||
import logging
|
||||
|
||||
log = logging.getLogger('app.dashboard')
|
||||
|
||||
dashboard_bp = Blueprint('dashboard', __name__)
|
||||
|
||||
@@ -250,6 +253,18 @@ def reconcile_api():
|
||||
})
|
||||
|
||||
|
||||
@dashboard_bp.route('/api/anomalies')
|
||||
@login_required
|
||||
def anomalies_api():
|
||||
from app.services.report_service import spending_anomalies
|
||||
try:
|
||||
items = spending_anomalies()
|
||||
except Exception as e:
|
||||
log.warning('[dashboard] anomalies_api failed: %s', e)
|
||||
items = []
|
||||
return jsonify({'anomalies': items})
|
||||
|
||||
|
||||
@dashboard_bp.route('/api/fx-history')
|
||||
@login_required
|
||||
def fx_history_api():
|
||||
|
||||
Reference in New Issue
Block a user