"""WhatsApp log model for inbound webhook messages.""" from __future__ import annotations from datetime import datetime from sqlalchemy import DateTime, Integer, String, Text from sqlalchemy.orm import Mapped, mapped_column from app.core.database import Base class WhatsAppLog(Base): __tablename__ = "whatsapp_log" id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True) from_number: Mapped[str] = mapped_column(String(50), nullable=False) message_text: Mapped[str] = mapped_column(Text, nullable=False) wa_message_id: Mapped[str | None] = mapped_column(String(100), nullable=True) ticket_id: Mapped[int | None] = mapped_column(Integer, nullable=True) ticket_number: Mapped[str | None] = mapped_column(String(30), nullable=True) received_at: Mapped[datetime] = mapped_column(DateTime, nullable=False) def __repr__(self) -> str: return f""