feat: Oracle CRM Page, Synthetic Client Data and Live Snapshot when hitting emotion hotpoint

This commit is contained in:
Sagnik
2026-04-19 00:43:01 +05:30
parent f616a33ab0
commit 4b21c2cad6
197 changed files with 105054 additions and 89 deletions

View File

@@ -153,7 +153,26 @@ async def login(body: LoginRequest):
@app.get("/api/auth/me", tags=["Auth"])
async def me(user: UserPrincipal = Depends(get_current_user)):
return {"user_id": user.user_id, "role": user.role}
pool = app.state.db_pool
if pool is None:
raise HTTPException(status_code=503, detail="Database unavailable.")
async with pool.acquire() as conn:
row = await conn.fetchrow(
"""
SELECT full_name, email
FROM users_and_roles
WHERE id = $1::uuid
""",
user.user_id,
)
return {
"user_id": user.user_id,
"role": user.role,
"full_name": row["full_name"] if row else None,
"email": row["email"] if row else None,
}
# ── Catalyst WebSocket (preserved from v1) ────────────────────────────────────