fix: InstitutionalReports — signal-aware category filter + Agri/Crypto/Bonds/Indices pills + Specialist Desks link

- Backend: category filter now ORs signal column so multi-category reports (category='multi') appear when filtering by Forex/Energy/Metals/Indices — fixes blank results
- Frontend: category pills expanded to match desk taxonomy (agri, crypto, bonds, indices added; equities kept for compatibility)
- Frontend: banner pointing to /specialist-desks clarifies the split between auto-fetched reports and manual desk report scheduling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-23 10:13:40 +02:00
parent 2fb683eec5
commit 2f9d067a94
2 changed files with 48 additions and 7 deletions

View File

@@ -114,7 +114,19 @@ def list_reports(
conditions.append("report_type = ?")
params.append(report_type)
if category:
conditions.append("category = ?")
# For categories that map to a signal column, also match reports
# where that signal is non-neutral (most reports have category='multi')
_signal_col = {
'forex': 'signal_forex',
'energy': 'signal_energy',
'metals': 'signal_metals',
'equities': 'signal_indices',
'indices': 'signal_indices',
}.get(category)
if _signal_col:
conditions.append(f"(category = ? OR {_signal_col} != 'neutral')")
else:
conditions.append("category = ?")
params.append(category)
if importance:
conditions.append("importance >= ?")