feat: generate approved profile snapshots
This commit is contained in:
@@ -75,6 +75,25 @@ class MemorySyncOutbox(Base):
|
||||
processed_at: Mapped[datetime | None] = mapped_column(DateTime)
|
||||
|
||||
|
||||
class ProfileSnapshot(Base):
|
||||
"""客户画像版本快照;只有审核通过的候选才能生成当前版本。"""
|
||||
|
||||
__tablename__ = "profile_snapshots"
|
||||
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
profile_uuid: Mapped[str | None] = mapped_column(String(36), unique=True)
|
||||
customer_id: Mapped[int] = mapped_column(BigInteger, nullable=False)
|
||||
version: Mapped[int] = mapped_column(BigInteger, nullable=False)
|
||||
snapshot: Mapped[dict[str, Any]] = mapped_column(JSON, nullable=False)
|
||||
generation_basis: Mapped[dict[str, Any] | None] = mapped_column(JSON)
|
||||
snapshot_hash: Mapped[str | None] = mapped_column(String(64))
|
||||
is_current: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
|
||||
current_customer_id: Mapped[int | None] = mapped_column(BigInteger, unique=True)
|
||||
generated_at: Mapped[datetime | None] = mapped_column(DateTime)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime, nullable=False)
|
||||
updated_at: Mapped[datetime] = mapped_column(DateTime, nullable=False)
|
||||
|
||||
|
||||
class MemoryConflict(Base):
|
||||
"""记忆冲突;库列名为 `status`,`resolution`/`severity`/`resolved_by` 必须映射。"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user