feat: Sprint 3 — test editing with versioning

Backend:
- migration 003: add parent_id to tests table
- PUT /api/tests/{id}: edit in place if no attempts, create new version otherwise
- GET /api/tests: show only latest versions (no successor)

Frontend:
- TestForm: extracted reusable form component
- TestCreate: refactored to use TestForm
- TestEdit: full edit mode with pre-populated form, version redirect on new version

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aleksey Razorvin
2026-03-21 13:28:06 +05:00
parent 2b5dc379e1
commit b2a3bda01b
8 changed files with 464 additions and 255 deletions
+6
View File
@@ -65,12 +65,18 @@ class TestOut(BaseModel):
allow_navigation_back: bool
is_active: bool
version: int
parent_id: Optional[int]
created_at: datetime
questions: list[QuestionOut] = []
model_config = {"from_attributes": True}
class TestUpdateResponse(BaseModel):
test: TestOut
is_new_version: bool
class TestListItem(BaseModel):
id: int
title: str