27 lines
1.2 KiB
Python
27 lines
1.2 KiB
Python
"""Internal persistence model for conversational investment-goal extraction."""
|
|||
|
|
|
||
|
|
from datetime import datetime
|
||
|
|
from typing import Any
|
||
|
|
|
||
|
|
from sqlalchemy import JSON, BigInteger, DateTime, String
|
||
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
||
|
|
|
||
|
|
from app.model.base import Base
|
||
|
|
|
||
|
|
|
||
|
|
class AdvisorGoalConversationExtraction(Base):
|
||
|
|
"""Append-only extraction snapshot; never exposed in the customer API."""
|
||
|
|
|
||
|
|
__tablename__ = "advisor_goal_conversation_extraction"
|
||
|
|
|
||
|
|
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||
|
|
message_id: Mapped[int] = mapped_column(BigInteger, unique=True, nullable=False)
|
||
|
|
session_id: Mapped[str] = mapped_column(String(64), nullable=False)
|
||
|
|
customer_id: Mapped[int] = mapped_column(BigInteger, nullable=False)
|
||
|
|
extraction_version: Mapped[str] = mapped_column(String(32), nullable=False)
|
||
|
|
extracted_fields: Mapped[dict[str, Any]] = mapped_column(JSON, nullable=False)
|
||
|
|
missing_fields: Mapped[list[str]] = mapped_column(JSON, nullable=False)
|
||
|
|
status: Mapped[str] = mapped_column(String(32), nullable=False)
|
||
|
|
created_at: Mapped[datetime] = mapped_column(DateTime, nullable=False)
|
||
|
|
updated_at: Mapped[datetime] = mapped_column(DateTime, nullable=False)
|