refactor: split table models into Base/Table/Public for proper FastAPI serialization
Add ProductBase, ProductPublic, ProductWithInventory and SkinConditionSnapshotBase, SkinConditionSnapshotPublic. Table models now inherit from their Base counterpart and override JSON fields with sa_column. All field_serializer hacks removed; FastAPI response models use the non-table Public classes so Pydantic coerces raw DB dicts → typed models cleanly. ProductCreate and SnapshotCreate now simply inherit their respective Base classes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
479be25112
commit
c09acc7c81
15 changed files with 225 additions and 198 deletions
|
|
@ -1,9 +1,7 @@
|
|||
"""Unit tests for Product.to_llm_context() — no database required."""
|
||||
from uuid import uuid4
|
||||
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from uuid import uuid4
|
||||
|
||||
from innercontext.models import Product
|
||||
from innercontext.models.enums import (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue