from uuid import UUID from fastapi import APIRouter from backend.app.db import operations from backend.app.api.schemas import CheckStart, CheckCommit, CheckAnswer router = APIRouter(prefix="/api/chat", tags=["chat"]) @router.get("/greeting") async def greeting(): return await operations.chat_greeting() @router.post("/checks", status_code=201) async def check_start(body: CheckStart): return await operations.check_start(body.reading_id) @router.post("/checks/{check_id}/commit") async def check_commit(check_id: UUID, body: CheckCommit): return await operations.check_commit(check_id, body.round, body.values) @router.post("/checks/{check_id}/answer") async def check_answer(check_id: UUID, body: CheckAnswer): return await operations.check_answer(check_id, body.round, body.data)