# app/models/schemas/chain.py — Chain Pydantic models from __future__ import annotations from pydantic import BaseModel class ChainCreate(BaseModel): name: str class ChainRow(BaseModel): id: str name: str created_at: float node_count: int = 0 class ChainTree(BaseModel): id: str name: str created_at: float nodes: list["NodeRow"] = [] # Avoid circular import — NodeRow imported at runtime from app.models.schemas.node import NodeRow # noqa: E402 ChainTree.model_rebuild()