feat(backend): add Pydantic schemas

This commit is contained in:
2025-04-15 22:57:23 +01:00
parent 3ed51bce74
commit cccdad8768
6 changed files with 517 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
from pydantic import BaseModel
class DifficultyCount(BaseModel):
"""Count of questions by difficulty."""
easy: int
medium: int
hard: int
class CategoryCount(BaseModel):
"""Question count for a category."""
name: str
slug: str
count: int
class PatternCount(BaseModel):
"""Question count for a pattern."""
name: str
slug: str
count: int
class StatsResponse(BaseModel):
"""Overall statistics response."""
total_questions: int
by_difficulty: DifficultyCount
by_category: list[CategoryCount]
by_pattern: list[PatternCount]