21 lines
879 B
Python
21 lines
879 B
Python
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 InteractionAudit(Base):
|
|
__tablename__ = "interaction_audit"
|
|
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
|
actor_type: Mapped[str] = mapped_column(String(16), nullable=False)
|
|
actor_id: Mapped[int | None] = mapped_column(BigInteger)
|
|
target_customer_id: Mapped[int | None] = mapped_column(BigInteger)
|
|
session_id: Mapped[str | None] = mapped_column(String(64))
|
|
portal: Mapped[str | None] = mapped_column(String(32))
|
|
action_type: Mapped[str] = mapped_column(String(64), nullable=False)
|
|
detail: Mapped[dict[str, Any]] = mapped_column(JSON, nullable=False)
|
|
created_at: Mapped[datetime] = mapped_column(DateTime, nullable=False)
|