feat: presentation demo mode — one-click private demo patient, screening on/off switch
CI / ruff · pytest (pull_request) Failing after 2m33s
CI / ruff · pytest (pull_request) Failing after 2m33s
- POST /auth/demo/fresh + «Демо: войти как Андрей» on the welcome screen: every sign-in gets a fresh private copy of veteran Andrey (consent, prescription, ЕМИАС record) and lands in the chat — no codes, nobody's crisis or half-done questionnaire leaks into another viewer. - Initial screening switch: SCREENING_ENABLED env default + /demo/settings + a toggle in the demo console; off → after consent straight to the chat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -288,3 +288,22 @@ async def demo_personas() -> list[DemoPersona]:
|
||||
)
|
||||
)
|
||||
return out
|
||||
|
||||
|
||||
@router.get("/demo/settings", tags=["demo"])
|
||||
async def get_demo_settings() -> dict[str, bool]:
|
||||
"""Presentation switches: `screening_enabled` — initial questionnaires after consent (off → straight to chat)."""
|
||||
from app.core import demo_settings
|
||||
|
||||
async with get_clinical_session() as s:
|
||||
return await demo_settings.get_all(s)
|
||||
|
||||
|
||||
@router.post("/demo/settings", tags=["demo"])
|
||||
async def set_demo_settings(body: dict[str, bool]) -> dict[str, bool]:
|
||||
from app.core import demo_settings
|
||||
|
||||
async with get_clinical_session() as s:
|
||||
if demo_settings.SCREENING in body:
|
||||
await demo_settings.set_screening(s, bool(body[demo_settings.SCREENING]))
|
||||
return await demo_settings.get_all(s)
|
||||
|
||||
Reference in New Issue
Block a user