Feature: серверная часть, ФИО и результаты теста в БД; правка ответа эскалация 80%

Made-with: Cursor
This commit is contained in:
2026-03-16 07:46:37 +00:00
parent 2de0d2cfbd
commit 05388b2ba6
14 changed files with 1971 additions and 48 deletions

32
backend/app/schemas.py Normal file
View File

@@ -0,0 +1,32 @@
"""Pydantic-схемы для API."""
from pydantic import BaseModel, Field
class StartRequest(BaseModel):
"""Запрос на начало обучения."""
fio: str = Field(..., min_length=1, max_length=500, description="ФИО сотрудника")
class StartResponse(BaseModel):
"""Ответ после регистрации начала обучения."""
participant_id: str
fio: str
class CompleteRequest(BaseModel):
"""Запрос на фиксацию результата теста."""
participant_id: str = Field(..., min_length=1)
score: int = Field(..., ge=0)
total_questions: int = Field(..., gt=0)
percent: float = Field(..., ge=0, le=100)
passed: bool
class CompleteResponse(BaseModel):
"""Ответ после сохранения результата."""
participant_id: str
saved: bool = True