Add live CEO briefing, Wereldexport CRM, halal engine, and realtime cockpit.
Ship export intel with contact filters and CRM push, Herman live digest with Telegram briefing, halal recommendation engine, revenue cockpit, and dashboard polling/WebSocket fixes.
This commit is contained in:
@@ -9,7 +9,9 @@ from fastapi.responses import StreamingResponse
|
||||
from app.config import settings
|
||||
from app.db import execute, fetch_all, fetch_one
|
||||
from app.services.briefing import (
|
||||
build_live_digest,
|
||||
collect_briefing_data,
|
||||
format_live_digest_text,
|
||||
generate_daily_briefing,
|
||||
serialize_stats,
|
||||
stream_daily_briefing,
|
||||
@@ -57,9 +59,9 @@ async def server_time():
|
||||
|
||||
|
||||
@router.get("/herman/briefing/stats")
|
||||
async def herman_briefing_stats():
|
||||
"""Live stats from DB — always fresh for dashboard panels."""
|
||||
stats = serialize_stats(collect_briefing_data())
|
||||
async def herman_briefing_stats(light: bool = False):
|
||||
"""Live stats from DB — light=1 skips halal engine for snelle poll-refresh."""
|
||||
stats = serialize_stats(collect_briefing_data(skip_halal=light))
|
||||
bookmarks = []
|
||||
bookmark_map = {}
|
||||
try:
|
||||
@@ -86,7 +88,20 @@ async def herman_briefing_stats():
|
||||
)
|
||||
except Exception:
|
||||
stats["rss_live"] = []
|
||||
return {"ok": True, "stats": stats, "bookmarks": bookmarks, "at": datetime.utcnow().isoformat()}
|
||||
return {"ok": True, "stats": stats, "bookmarks": bookmarks, "live_digest": build_live_digest(stats), "at": datetime.utcnow().isoformat()}
|
||||
|
||||
|
||||
@router.get("/herman/briefing/live-text")
|
||||
async def herman_briefing_live_text():
|
||||
"""Compacte live samenvatting voor Telegram / bots."""
|
||||
stats = serialize_stats(collect_briefing_data())
|
||||
digest = build_live_digest(stats)
|
||||
return {
|
||||
"ok": True,
|
||||
"text": format_live_digest_text(digest),
|
||||
"live_digest": digest,
|
||||
"at": datetime.utcnow().isoformat(),
|
||||
}
|
||||
|
||||
|
||||
@router.post("/herman/briefing")
|
||||
|
||||
Reference in New Issue
Block a user